Delay loading of GStreamer DLLs on Windows

Andy Robinson andy at seventhstring.com
Tue Dec 8 06:45:26 PST 2015


I have a Windows app which reads sound files. I want it to be able to 
use GStreamer if installed, to be able to open a wider variety of file 
formats. But it can run perfectly well without GStreamer so I don't want 
to force my users to install GStreamer.

Using Visual Studio 2013

So I need to tell the linker to delay-load the GStreamer libraries, 
which I do like this, in the link command:
    gstreamer-1.0.lib /DELAYLOAD:libgstreamer-1.0-0.dll

However this gets me an error from the linker:
LINK : fatal error LNK1194: cannot delay-load 'libgstreamer-1.0-0.dll' 
due to import of data symbol '__imp___gst_int_range_type'; link without 
/DELAYLOAD:libgstreamer-1.0-0.dll

MS docs say you can't delay-load a dll if it exports data symbols.

Does anyone know a way around this? Have any of you written a Windows 
app that uses GStreamer if the DLLs are present, but runs without them 
if they aren't?

There is one obvious but clumsy workaround: use explicit LoadLibrary, 
then locate pointers to all the desired functions & data. Horrible, and 
it seems to me that it would involve pretty much re-writing all the gst 
header files.

Hoping someone can help,
Andy Robinson, Seventh String Software, www.seventhstring.com


More information about the gstreamer-devel mailing list