Search code examples
gstreamerglibmsvcrt

Where can I download the msvcrt.dll that offers function rand_s?


I was trying to run the GStreamer hello-world demo, after successful compilation, but the application doesn't run as expected. An error message pops up and the application quits. The message says the msvcrt.dll in my computer doesn't have function rand_s. The Dependency Walker is shown below. enter image description here I'm pretty sure it is libglib-2.0-0.dll that came with GStreamer caused the trouble. So, where can I download the msvcrt.dll that offers function rand_s? Thanks in advance.


Solution

  • I solved my problems with InkScape by nulling out _s in rand_s in .dll import table of glib*.dll.

    Technically, rand_s are available in msvcr*.dll if you install appropriate redistributable. Having installed sequentially MSVS 2005, 2008, 2010, 2012, 2013 redistributables, I can see rand_s in msvcr100.dll (2010), msvcr110.dll (2012), msvcr120.dll (2013), but not in msvcrt.dll. msvcr90.dll and msvcr80.dll are missing after installation, I don't know why. It seems that some versions of Windows contain rand_s in msvsrt.dll and FLOSS developers expected it to be true everywhere, but in fact one must link against msvcr*.dll to really get these features.

    You can also try to install MSVS redistributable 2010 or higher and copy msvcr*.dll from system32 to gstreamer using msvcrt.dll file name. I haven't tried it.