Package Details: mingw-w64-qt5-base-static 5.13.2-1

Git Clone URL: (read-only)
Package Base: mingw-w64-qt5-base-static
Description: A cross-platform application and UI framework (mingw-w64)
Upstream URL:
Licenses: custom, GPL3, LGPL3, FDL
Groups: mingw-w64-qt5
Submitter: ant32
Maintainer: Martchus
Last Packager: Martchus
Votes: 10
Popularity: 0.000001
First Submitted: 2013-08-28 23:57
Last Updated: 2019-11-12 16:31

Required by (63)

Sources (33)

Pinned Comments

Martchus commented on 2017-01-10 21:24

Notes about using static Qt with CMake:

* Checkout the notes about the static version in the PKGBUILD itself
* Seems like find_package(Qt5Core) is still required when building static version. I think this is not really a problem, one just has to know it.
* Here is a simple example:
* I also included a commits showing how to link statically against against Qt plugins and dependencies of Qt itself.

Note about using static Qt with qmake:
* Use to fix inclusion of static plugins (patch will be included on next update, meanwhile it can also be applied manually after the mingw-w64-qt5-base package has been installed)
* Add `CONFIG+=no_smart_library_merge` to qmake arguments to prevent qmake from messing linker flags for freetype2/harfbuzz (which have dependency cycle).

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:

For general discussion and issues not only concerning this variant please use the comment section of the package mingw-w64-qt5-base.

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

Martchus commented on 2017-03-18 17:36

> it's simply because that name is hardcoded in cmake source code :(

Oh, you mean the sources of CMake itself. I guess then we just live with including the non static module, too.

I already have a fix for the test module. Just need to check whether it works.

I guess the condition `!exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true` in create_cmake.prf is preventing the variables for private include dirs to be set. Not sure how to fix it yet.
EDIT: The issue seems to occur in other cases than this mingw-w64 package, too. Annulen on #qt-labs has already tracked it down to:

Haven't looked into the issue about the DB plugins yet. Did you any of the things I proposed in the last comment? Do you actually need the plugins or would silencing the errors be good enough?

woggioni commented on 2017-03-17 11:01

I also noticed that strangely in ${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5Gui/StaticQt5GuiConfig.cmake at line 65 there is


while the Gui module has private headers (also proved by /usr/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:57 in standard qt5-base package). This problem also applies to the dynamic variant (mingw-w64-qt5-base).

Martchus commented on 2017-03-16 18:17

So I'll have to fix that, too.

I have to admit that my approach with the 'Static'-prefix is not the best because it requires to change a lot of things. Unfortunately I don't know another way to solve the problem. Installing dynamic and static version in the same prefix is just not officially supported. Maybe it would be best to put the static variant in another prefix like MSYS2 does. However, then it would not be possible to use dynamic and static variant during the same build which is quite nice to build dynamic and static libs of projects depending on Qt at the same time.

woggioni commented on 2017-03-16 17:47

Meanwhile, I discovered why AUTOMOC, AUTOUIC and AUTORCC do not work without including QtCore: it's simply because that name is hardcoded in cmake source code :(

Martchus commented on 2017-03-16 13:20

Using static version with CMake is a mess, but I'll try to fix it.

woggioni commented on 2017-03-16 10:23

I noticed that if you run
grep -nr " Qt5::" StaticQt5*
in ${pkgdir}/usr/x86_64-w64-mingw32/lib/cmake
you get a lot matches that I think should be " StaticQt5::". I noticed because I tried to use StaticQt5::Test from cmake in one of my projects and it was broken because of "/usr/x86_64-w64-mingw32/lib/cmake/StaticQt5Test/StaticQt5TestConfigExtras.cmake" which bears:

set_property(TARGET Qt5::Test ...

instead of

set_property(TARGET StaticQt5::Test ...

ant32 commented on 2017-02-28 00:31

You can compile libpq staticaly by adding the following two lines to the mingw-w64-postgresql PKGBUILD

${_arch}-ar rvs -o libpq.a src/interfaces/libpq/*.o
mv libpq.a "${pkgdir}/usr/${_arch}/lib/"

Martchus commented on 2017-02-22 15:26

PostgeSQL is currently not available as static lib. Hence, the current attempt is to link against the dynamic version also on static build, but apparently this does not work. Maybe I should just disable this plugin in the static variant.

In the case of MariaDB, I assume the correct static library would be mariadbclient. Not sure why the dynamic library is attempted to be used instead.

You can play around with the linker flags by modifying /usr/$_arch/lib/qt/plugins/sqldrivers/qsqlpsql.static.prl and qsqlmysql.static.prl. In the last line of those files the linker flags for CMake are defined.

What are the final flags passed by CMake to the linker? I suppose the flags in the mentioned files are messed up so linking against libs explicitly as dynamic libs doesn't work. Note that sometimes CMake creates an extra file for the flags, eg. CMakeFiles/yourapp.dir/linklibs.rsp.

To prevent CMake from finding the static plugins at all, you can just remove the corresponding module.

woggioni commented on 2017-02-22 13:13

compiling the example with STATIC_QT=ON I noticed that QtSql module now links to non existing libs -lmariadb and -lpq, here is what I got from the linker:

/usr/lib/gcc/x86_64-w64-mingw32/6.3.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lmariadb
/usr/lib/gcc/x86_64-w64-mingw32/6.3.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lpq
/usr/lib/gcc/x86_64-w64-mingw32/6.3.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lmariadb
/usr/lib/gcc/x86_64-w64-mingw32/6.3.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lpq

woggioni commented on 2017-01-12 09:18

@Martchus Great job! Thank you