QtGStreamer doesn't link against needed libs when cross-building for Windows

George Kiagiadakis kiagiadakis.george at gmail.com
Sat Jun 1 01:33:11 PDT 2013


On Sat, Jun 1, 2013 at 7:56 AM, Nikos Chantziaras <realnc at gmail.com> wrote:
> I'm using MXE (a mingw cross-compiler) to build various libraries for
> Windows under Linux.  Qt and GStreamer itself, and all their needed deps,
> build fine.  QtGStreamer however fails horribly.  It seems it doesn't link
> against the libraries it needs and the result is a humongous amount of
> "undefined reference" linker errors:
>
>   http://pastebin.com/raw.php?i=NYGBrcdE
>
> I'm building with:
>
>   cmake .. \
>         -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
>         -DQTGSTREAMER_STATIC=ON \
>         -DQTGSTREAMER_EXAMPLES=OFF \
>         -DQTGSTREAMER_TESTS=OFF
>
> What can I do to get a correct link step?

I believe this is a build system bug (actually, 2 different bugs),
caused by -DQTGSTREAMER_STATIC=ON and also by the fact that your Qt
library is probably static as well, right?

For the dllimport warnings, I guess some hackery is needed to detect
in {QGlib,QGst,...}/global.h that you are building STATIC and set the
{QTGLIB, QTGSTREAMER, ...}_EXPORT macros defined to nothing.

For the QtGui linking failure, probably the target_link_libraries()
needs to change to use ${QT_QTGUI_LIBRARIES} instead of
${QT_QTGUI_LIBRARY} and similar for other libraries...

Static configuration is a pain, tbh. I have never tested linking with
a static Qt library, so I guess that's why I never found this issue.


More information about the gstreamer-devel mailing list