[Bug 797185] Fix API export/import decorators in general and "inconsistent DLL linkage" with MSVC on Windows

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Sep 21 10:25:35 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=797185

--- Comment #3 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Created attachment 373721
  --> https://bugzilla.gnome.org/attachment.cgi?id=373721&action=edit
libs: fix 'inconsistent DLL linkage' warnings on Windows

For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list