Package Details: mingw-w64-qt5-base 5.9.2-1

Git Clone URL: (read-only)
Package Base: mingw-w64-qt5-base
Description: A cross-platform application and UI framework (mingw-w64)
Upstream URL:
Licenses: custom, GPL3, LGPL3, FDL
Groups: mingw-w64-qt5
Submitter: Martchus
Maintainer: Martchus
Last Packager: Martchus
Votes: 12
Popularity: 0.586377
First Submitted: 2016-08-30 21:28
Last Updated: 2017-10-16 17:38

Sources (34)

Pinned Comments

Martchus commented on 2016-07-10 19:47

All my packages are managed at GitHub where you can also contribute directly:
Patches for this package are managed at:

There also exist a binary repository:

If you would like to contribute, here is a list of known bugs and things needing improvement:
- The linker library search paths for applications which need to be build for the host architecture aren't set correctly. Hence those paths are currently set manually which is quite hacky. Affected packages are mingw-w64-qt5-declarative and mingw-w64-qt5-tools and (also the apple-darwin versions).
- Compiling QtAV using the ANGLE version doesn't work. I don't know whether other applications/libs using OpenGL via Qt are also affected but it is very likely.

Also note the comments about the different variants inside the PKGBUILD itself.

Latest Comments

z3ntu commented on 2017-10-17 20:31

@Martchus: Thanks, I uninstalled and built and installed again. I tried to make it work with extra-x86_64-build but there were too many dependencies to manually add... I'll remember for next time. Thanks for maintaining the package!

Martchus commented on 2017-10-16 21:13

Seems like it tries to link Qt Widgets against the currently installed version of Qt Core and Gui. This is not possible because private ABI might (and actually has) changed. Hence those linker errors only relate to private symbols of the Qt library.

Not sure what makes Qt linking against the installed/previous version now. I'd simply work around this by uninstalling the previous version or build in a clean chroot. I always do the latter and hence didn't encounter this issue when building myself.

z3ntu commented on 2017-10-16 20:59

I get link errors with 5.9.2:

i686-w64-mingw32-g++ -g -shared -Wl,-subsystem,windows -Wl,--out-implib,/mnt/hdd/aur/mingw-w64-qt5-base/src/build-i686-w64-mingw32/lib/libQt5Widgets.dll.a -o ../../lib/Qt5Widgets.dll object_script.Qt5Widgets.Release -lcomdlg32 -loleaut32 -limm32 -luuid -ladvapi32 -ljpeg -lpng -L/usr/i686-w64-mingw32/lib -lfreetype -lbz2 -lharfbuzz -lglib-2.0 -lws2_32 -lole32 -lwinmm -lshlwapi -lpcre -lintl -liconv -lgraphite2 -lglu32 -lopengl32 -lgdi32 -luser32 -L/mnt/hdd/aur/mingw-w64-qt5-base/src/build-i686-w64-mingw32/lib /usr/i686-w64-mingw32/lib/libQt5Gui.dll.a /usr/i686-w64-mingw32/lib/libQt5Core.dll.a -lshell32 -luxtheme -ldwmapi
./.obj/release/qdirmodel.o: In function `ZNK16QDirModelPrivate4nameERK11QModelIndex':
/mnt/hdd/aur/mingw-w64-qt5-base/src/qtbase-opensource-src-5.9.2/src/widgets/itemviews/qdirmodel.cpp:1285: undefined reference to `_imp___ZN16QFileSystemEntry10isRootPathERK7QString'
./.obj/release/qdirmodel.o: In function `ZNK9QDirModel8fileNameERK11QModelIndex':
/mnt/hdd/aur/mingw-w64-qt5-base/src/qtbase-opensource-src-5.9.2/src/widgets/itemviews/qdirmodel.cpp:1108: undefined reference to `_imp___ZN16QFileSystemEntry10isRootPathERK7QString'
./.obj/release/qfileiconprovider.o: In function `ZNK17QFileIconProvider4typeERK9QFileInfo':
/mnt/hdd/aur/mingw-w64-qt5-base/src/qtbase-opensource-src-5.9.2/src/widgets/itemviews/qfileiconprovider.cpp:303: undefined reference to `_imp___ZN16QFileSystemEntry10isRootPathERK7QString'
./.obj/release/qfileiconprovider.o: In function `ZNK17QFileIconProvider4iconERK9QFileInfo':
/mnt/hdd/aur/mingw-w64-qt5-base/src/qtbase-opensource-src-5.9.2/src/widgets/itemviews/qfileiconprovider.cpp:252: undefined reference to `_imp___ZN16QFileSystemEntry10isRootPathERK7QString'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile.Release:867: ../../lib/Qt5Widgets.dll] Error 1
make[3]: Leaving directory '/mnt/hdd/aur/mingw-w64-qt5-base/src/build-i686-w64-mingw32/src/widgets'
make[2]: *** [Makefile:36: release] Error 2
make[2]: Leaving directory '/mnt/hdd/aur/mingw-w64-qt5-base/src/build-i686-w64-mingw32/src/widgets'
make[1]: *** [Makefile:627: sub-widgets-make_first] Error 2
make[1]: Leaving directory '/mnt/hdd/aur/mingw-w64-qt5-base/src/build-i686-w64-mingw32/src'
make: *** [Makefile:45: sub-src-make_first] Error 2
==> ERROR: A failure occurred in build().

Martchus commented on 2017-10-16 17:57

Updated to 5.9.2. I also fixed qmake so it now links against static plugins by default when using the static variant. This didn't work (anymore) because of our way to merge shared and static builds. However, this revealed further bugs:
* qmake is messing dependency cycle of static freetype and harfbuzz. This can be worked around by adding `CONFIG+=no_smart_library_merge` to qmake arguments.
* qmake does not include dependencies of static Qt modules when only linking against a plugin which pulls that Qt module but not using the module itself explicitly. Just link against the module explicitly by adding `QT+=the_module` to qmake arguments.
* The Qt Network module can not be used with the static MySQL plugin because the plugin's its dependency mariadb-connector-c uses OpenSSL 1.1 while Qt is still using OpenSSL 1.0. Both versions can not be combined. Qt 5.10 will fix this by supporting OpenSSL 1.1.

BTW: If you need Qt location but not the included mapbox-gl plugin, I suggest disabling this feature as it requires a lot of time to compile. The binaries provided at my repository will not include the plugin anymore (for now).

Martchus commented on 2017-09-04 16:41

> As i said, i have missing references in libQt5Widgets.a(qwindows{vista|xp}style.o) and libQt5Gui.a(qopenglpaintengine.o).

I need the cmake/qmake call, the compiler/linker line which fails and the error output. Otherwise I can just do some guessing.

> I noticed that neither qopenglpaintengine.a nor qwindows*.a files exist in mingw-w64-qt5-base-static, but i guess i need them at compile-time?

If you believe some files are missing in your mingw-w64-qt5-base-static packages, just download the one from my repository (linked in the pinned comment) and compare the files. Note that the mentioned libraries are 'static plugins', so they are in an extra subdirectory (this is not Windows specific at all). Eg. libqwindows.a should be located under /usr/x86_64-w64-mingw32/lib/qt/plugins/platforms/libqwindows.a. You need those files at compile time, if you want to use them (you very likely want the platform integration plugin).

Note that this package also contains symlinks for the static plugins eg. /usr/x86_64-w64-mingw32/lib/libqwindows.a, but this shouldn't actually be required (just some precaution to prevent errors in case of plugin path is missing).

> As the static libQt5*.a files only contain the references?
The libQt5*.a libraries should not contain any references to the plugins. The plugins are optional additions loaded via dlopen (or similar under Windows) or in case of the static variant 'optionally built-in'. In the latter case the actual application must contain the references (eg. via

hein09 commented on 2017-09-04 09:39

Thanks for your help!

I applied the patch you linked.
Unfortunately, i can't get it to work, i still have the linking problems with the windows-stuff...
I'm really not well-versed, so please bear with me :)
As i said, i have missing references in libQt5Widgets.a(qwindows{vista|xp}style.o) and libQt5Gui.a(qopenglpaintengine.o).
I noticed that neither qopenglpaintengine.a nor qwindows*.a files exist in mingw-w64-qt5-base-static, but i guess i need them at compile-time?
As the static libQt5*.a files only contain the references?
But why does dynamic linking then work, when mingw-w64-qt5-base too does not contain these files?
Have they maybe been created while building the mingw-packages and linked into the .dll's, but not copied over or built when composing the static package?

I guess i'll wait for the next update, this seems to go far beyond my understanding...

Martchus commented on 2017-08-25 16:42

@hein09 I found a workaround. See my previous comment for an answer to your last question and what the related problems are (if you haven't read it yet).

It seems the issue that qmake is messing dependency cycle between freetype2 and harfbuzz can be easily worked around by simply adding `no_smart_library_merge` to the config. No need to recompile anything. Maybe I better keep 0030-Prevent-qmake-from-messing-static-lib-dependencies.patch for CMake.

So the following works for me:
pacman -Syu qt5-examples
cd some/empty/directory
x86_64-w64-mingw32-qmake-qt5 CONFIG+=static CONFIG+=no_smart_library_merge /usr/share/doc/qt/examples/widgets/mainwindows
make -j4
wine mainwindow/release/mainwindow.exe

No linker errors. And when applying `mainwindow.exe` even has the windows platform plugin built-in. Only drawback is that the linker line is now quite long (but g++ seems to handle it without problems).

(Instead of rebuilding everything, you can also do the changes of in your local installation. I'll add the patch with the next update.)

Martchus commented on 2017-08-25 15:39

I don't remember the purpose so I'll just drop it in the next update. However, when something explicitly supports Windows, this might not necessarily include cross compilation with mingw-w64 (which is not supported by upstream).

> What should trigger this automatic adding?

If you're using CMake, nothing will pull those dependencies if you omitted patch 0023-Allow-usage-of-static-version-with-CMake.patch.
(BTW, this monster patch will be spitted in next update, see

If you're using qmake, some qmake internal magic triggers adding those dependencies. However, it seems to mess things up under certain conditions. At least the cyclic dependency between harfbuzz and freetype2 is not handled correctly. Hence I disabled this when building static libraries (see 0030-Prevent-qmake-from-messing-static-lib-dependencies.patch). However, when building/linking the final application it is still enabled (unless you use `CONFIG+=staticlib`). This way the static library dependencies are at least preserved for CMake so building a statically linked application using CMake works.

When building with qmake you'll unfortunately either get linker errors about freetype2/harfbuzz (if you don't add `CONFIG+=staticlib`) or get linker errors about other missing dependencies not explicitly mentioned in the mkspec (iconv, but also dependencies of the plugins).

Those problems with qmake are currently not preventing mingw-w64-qt5-tools to build because linking against static plugins with qmake is broken anyways and hence the freetype2/harfbuzz issue does not seem to occur.

BTW: If you're wondering why it links against pcre *and* pcre2, the reason is that Qt recently switched to version 2 but pcre is still pulled by harfbuzz for glib2.

To summarize: The static variant only works with CMake correctly.
1. Linking against static plugins with qmake needs to be fixed. It is currently simply not done. This is caused by 0022-Merge-shared-and-static-library-trees.patch. Fixing it should be quite easy:
2. But this leads to the next problem. The dependency cycle between freetype2 and harfbuzz must be handled correctly by qmake. The patch 0030-Prevent-qmake-from-messing-static-lib-dependencies.patch is only sufficient for CMake. To make qmake work when 1. has been fixed, qmake must be improved to handle the dependency cycle between freetype2 and harfbuzz.

So I'm not sure why iconv isn't added in your case. It should be if your config doesn't contain `staticlib` which should not be the case by default. But if you want to link against static plugins (which is likely the case when doing a static build) you're currently not coming very far with qmake anyways.

hein09 commented on 2017-08-24 10:13

What was the purpose of this patch? (0020)
As far as i understand it it just disabled taking the gcc-path in the toolchain.prf file, which explicitely supports windows as a platform (seems kind of self-defeating?)

`-liconv` is indeed the last entry in `Qt5Core.static.prl`.
Then the problem seems to be the automatic adding, which is just not performed.
I also get undefined references for libQt5Widgets.a(qwindows{vista|xp}style.o) and libQt5Gui.a(qopenglpaintengine).
What should trigger this automatic adding?
(and should i move this discussion to the static AUR-package?)

Martchus commented on 2017-08-15 17:28

Not sure about 0020-Disable-determing-default-include-and-lib-dirs-at-qm.patch. It can likely be removed but I would have to test it first.

About iconv: I'm actually not sure which libs need to be specified explicitly in the mkspec and which are added automatically by the configure script. Eg. cyclic dependency between freetype2 and harfbuzz would not be resolved correctly without doing it explicitly in the mkspec. However, iconv is added automatically - at least it works here. Does `/usr/x86_64-w64-mingw32/lib/Qt5Core.static.prl` contain the library? In my case `-liconv` is the last library in `QMAKE_PRL_LIBS`. And it also seems to be picked up - at least I'm not getting linker errors. But adding iconv explicitly would not hurt, too. So if it is causing trouble for you, I can add it. I guess the explicitly added pcre2 would not be required, too. At least my QMAKE_PRL_LIBS contains it twice.

All comments