[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] Qt5 Windows platform plugin location

From: Moritz Bunkus
Subject: [Mingw-cross-env-list] Qt5 Windows platform plugin location
Date: Sat, 18 Jan 2014 11:25:35 +0100


Question first, longer explanation later: how do I determine the link location and library requirements for the Qt5 Windows platform plugin automatically?

I just started porting my Qt4 application that I've previously only run on Linux to Qt5 and MXE[1]. I have tons of experience with MXE itself as I've been using it for years for my project[2]. Anyway.

What I do (assuming ${host} is set to something like x86_64-w64-mingw32):

- get the output of `${host}-pkg-config --cflags Qt5Core Qt5Gui` and `${host}-pkg-config --libs Qt5Core Qt5Gui`
- compile and link with those settings

Note that I'm not using qmake because this program is part of a larger suite of programs (again [2]) that uses a different build system.

Works fine so far. Executing the program on Windows, however, does not as an error message appears that Qt5 cannot load the platform plugin "windows". I googled that, and turns out that those platform plugins are usually DLLs you if you compile dynamically, and if statically you have to include some code to load the plugin[3] and link against libqwindows.a.

Problem is libqwindows.a is not installed in the library locations reported by `${host}-pkg-config --libs`. Instead it's installed in $MXE/usr/${host}/qt5/plugins/platform.

Adding that path manually via -L leads to the next problem: undefined symbols at link time starting with FT_… Manually adding `${host}-pkg-config --libs freetype2` finally lets the application link and execute on Windows properly.

Being able to do that manually is one thing. What I'm now facing is the problem of implementing automatic detection for this with configure. I definitely can hack up some shell script magic auto-guessing the lib path from existing -L entries returned by ${host}-pkg-config, but that sounds hackish (and it would only serve me and not other users of MXE).

So my questions are:

1. Should that platform library path be output by ${host}-pkg-config --libs? If so for which package?
2. How do I determine automatically which additional libraries I need to link against for that platform library? Preferably via ${host}-pkg-config.

If you agree that this should be improved from MXE's side then I'm willing to develop patches to MXE's Qt5 installation routines.

Thanks for any insight.

Kind regards,

[1]  currently at revision 897321906cb3aabca3606602aa1329ef87bc307c
[2]  MKVToolNix – http://www.bunkus.org/videotools/mkvtoolnix/
[3]  C++ code required for activating the platform plugin manually:
#include <QtPlugin>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]