Unsolved Qt 5.10 mingw64 static building failed
-
Hi,
I have been tried to build a static version of Qt 5.10 from source using mingw64 (v5.3, 64-bit).
My configuration is:
-static -debug-and-release -platform win32-g++ -prefix C:\Qt\Static_64\5.10.0 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-sqlite -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests
The building stopped at errors:
g++: error:
C:\Qt\Static_64\src\qt-everywhere-src-5.10.0\qtimageformats\plugins\imageformats\libqwebp.a: No
such file or directory
mingw32-make[4]: *** [....\bin\dumpdoc.exe] Error 1
mingw32-make[4]: Target 'first' not remade because of errors.
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Target 'first' not remade because of errors.
mingw32-make[2]: *** [sub-dumpdoc-make_first-ordered] Error 2
mingw32-make[2]: Target 'first' not remade because of errors.
mingw32-make[1]: *** [sub-tools-make_first] Error 2
mingw32-make[1]: Target 'first' not remade because of errors.
mingw32-make: *** [module-qtactiveqt-make_first] Error 2compiler\qqmlpropertyvalidator.cpp: In member function 'QVector<QQmlCompileError>
QQmlPropertyValidator::validateObject(int, const QV4::CompiledData::Binding*, bool) const':
compiler\qqmlpropertyvalidator.cpp:82:27: warning: assuming signed overflow does not occur when
assuming that (X + c) < X is always false [-Wstrict-overflow]
QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex, const
QV4::CompiledData::Binding *instantiatingBinding, bool populatingValueTypeGroupProperty) const
^C
:\Qt\Static_64\src\qt-everywhere-src-5.10.0\qtbase\plugins\platforms\libqwindows.a(qwindowssystemtr
ayicon.o):qwindowssystemtrayicon.cpp:(.text+0x9c6): undefined reference to
`__imp_ChangeWindowMessageFilterEx
'
collect2.exe: error: ld returned 1 exit statusmingw32-make[4]: *** [....\bin\qmltestrunner.exe] Error 1
mingw32-make[4]: Target 'first' not remade because of errors.
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Target 'first' not remade because of errors.
mingw32-make[2]: *** [sub-qmltestrunner-make_first] Error 2C
:\Qt\Static_64\src\qt-everywhere-src-5.10.0\qtbase\plugins\platforms\libqwindows.a(qwindowssystemtr
ayicon.o):qwindowssystemtrayicon.cpp:(.text+0x9c6): undefined reference to
`__imp_ChangeWindowMessageFilterEx
'
collect2.exe: error: ld returned 1 exit statusmingw32-make[4]: *** [....\bin\qml.exe] Error 1
mingw32-make[4]: Target 'first' not remade because of errors.
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Target 'first' not remade because of errors.
mingw32-make[2]: *** [sub-qml-make_first] Error 2
mingw32-make[2]: Target 'first' not remade because of errors.
mingw32-make[1]: *** [sub-tools-make_first] Error 2
mingw32-make[1]: Target 'first' not remade because of errors.
mingw32-make: *** [module-qtdeclarative-make_first] Error 2
mingw32-make: Target 'first' not remade because of errors.mingw32-make : C:\Qt\Static_64\src\qt-everywhere-src-5.10.0\qtbase\plugins\platforms\libqwindows.a(
qwindowssystemtrayicon.o):qwindowssystemtrayicon.cpp:(.text+0x9c6): undefined reference to
`__imp_ChangeWindowMessageFilterEx'
(C:\Qt\Static_64...essageFilterEx':String) [], RemoteE
xception
+ FullyQualifiedErrorId : NativeCommandErrorcollect2.exe: error: ld returned 1 exit status
mingw32-make[4]: *** [....\bin\dumpdoc.exe] Error 1
mingw32-make[4]: Target 'install' not remade because of errors.
mingw32-make[3]: *** [release-install] Error 2
mingw32-make[3]: Target 'install' not remade because of errors.
mingw32-make[2]: *** [sub-dumpdoc-install_subtargets-ordered] Error 2
mingw32-make[2]: Target 'install' not remade because of errors.
mingw32-make[1]: *** [sub-tools-install_subtargets] Error 2
mingw32-make[1]: Target 'install' not remade because of errors.
mingw32-make: *** [module-qtactiveqt-install_subtargets] Error 2C
:\Qt\Static_64\src\qt-everywhere-src-5.10.0\qtbase\plugins\platforms\libqwindows.a(qwindowssystemtr
ayicon.o):qwindowssystemtrayicon.cpp:(.text+0x9c6): undefined reference to
`__imp_ChangeWindowMessageFilterEx
'
collect2.exe: error: ld returned 1 exit status
mingw32-make[4]: *** [....\bin\qml.exe] Error 1
mingw32-make[4]: Target 'install' not remade because of errors.
mingw32-make[3]: *** [release-install] Error 2
mingw32-make[3]: Target 'install' not remade because of errors.
mingw32-make[2]: *** [sub-qml-install_subtargets] Error 2C
:\Qt\Static_64\src\qt-everywhere-src-5.10.0\qtbase\plugins\platforms\libqwindows.a(qwindowssystemtr
ayicon.o):qwindowssystemtrayicon.cpp:(.text+0x9c6): undefined reference to
`__imp_ChangeWindowMessageFilterEx
'
collect2.exe: error: ld returned 1 exit statusmingw32-make[4]: *** [....\bin\qmltestrunner.exe] Error 1
mingw32-make[4]: Target 'install' not remade because of errors.
mingw32-make[3]: *** [release-install] Error 2It seems Qt could not locate 'libuser32.a', which actually exists. Any idea how to fix it? The same compiler and configuration builds successfully with Qt 5.9.1
-
@gzhang said in Qt 5.10 mingw64 static building failed:
C:\Qt\Static_64\src\qt-everywhere-src-5.10.0\qtimageformats\plugins\imageformats\libqwebp.a: No
such file or directoryThat is the only error I see. I don't see anything about libuser32.a.
And to me that error suggests the plugin was not compiled and therefore can't be found.
Second problem is your missing references.. Here is a link showing that there is an issue with mingw and those particular exports:
https://sourceforge.net/p/mingw-w64/mailman/message/35677950/
From the sounds of it, it was patched in mingw, however you may be using an older version.
I've found when building qt with mingw64 in the past that it is VERY picky. You will need to use the exact version that was used for the official Qt build. If you don't expect to run into a lot of problems like you are seeing with undefined externals and such.
-
Thanks! I have been using the mingw version that comes with the official Qt. Strange that it compiled with 5.9.1 but not 5.10.0. Since the official release has not included a 64-bit mingw, I suppose we can only wait for 5.11, where it says 'upgrade to mingw 64 bit': https://wiki.qt.io/Qt_5.11_Tools_and_Versions
-
@gzhang did you find out how to fix this?