GNOME Bugzilla – Bug 771029
MSVC can't link against autotools-build generated DLLs
Last modified: 2016-09-30 07:04:58 UTC
The change https://cgit.freedesktop.org/gstreamer/gstreamer/commit/gst/gstconfig.h.in?id=22b892b44f5005d7af8d50df313e759bfdb1acd0 has it so autotools-generated gstconfig.h won't ever expand GST_EXPORT to __declspec(dllimport) in user-of-gstreamer builds. I'm not an expert on windows object linking so maybe it was somehow subtly broken before, and not working at all is better? But if I change the expanded GSTCONFIG_USE_MSVC_DECLSPEC in gstconfig.h from '0' to '1' in the released 1.9.2 gstreamer devel package, then I am able to build a plugin with MSVC that can also work at runtime.
I have a patch for this that I'm in the process of testing. Need to make sure that we cover all the cases this time and check that it works both for native and cross builds.
commit b6e69ffdfb3bb21dbada8f01b488ae877f8d205c Author: Nirbheek Chauhan <nirbheek@centricular.com> Date: Thu Sep 8 12:58:54 2016 +0530 gstconfig: Use __declspec when built with MinGW and linking with MSVC Earlier we were only using __declspec(dllexport/import) when we were built with MSVC because when built with MinGW and linking with MinGW we don't need it (and we get linker errors because of it). However, when we're built with MinGW and someone wants to link to us with MSVC, we still need the prototypes to have __declspec(dllimport) since MSVC cannot do auto-import like GCC can. https://bugzilla.gnome.org/show_bug.cgi?id=771029