Unable to compile Qt5.8 with MingW 64 bit compiler
-
I have successfully compiled QT5.8.0 with MinGW w64 x64 5.4.0. recently. Be sure to check out all following links if you run into problems:
https://wiki.qt.io/Building_Qt_5_from_Git
http://doc.qt.io/qt-5/build-sources.html
https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
https://wiki.qt.io/MinGW
https://wiki.qt.io/Mingw-64-bit
http://doc.qt.io/qt-5/windows-requirements.html#gcc-mingw-builds
http://doc.qt.io/qt-5/supported-platforms-and-configurations.html
http://doc.qt.io/qt-5/windows-building.html
https://wiki.qt.io/Building_Qt_Desktop_for_Windows_with_MinGWIt was only difficult for me because I did not read all that information beforehand. I used OpenSSL 1.0.2k and ICU 57.1 (it is optional, you need MSYS for both of them).
This is a direct link to the toolchain which I used: https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/mingw-builds/5.4.0/threads-posix/seh/
Make sure that it suits you, I remeber that GCC's C++ ABI changed at some 5.x version.
If you still want to try building it with your version try searching for this header in all files of your toolchain - it is required for MinGW build. By the way, the toolchain which I have has this include file inside, no SDK required.
#if defined(Q_CC_MINGW) # define HAS_UI_VIEW_SETTINGS_INTEROP
-
I have successfully compiled QT5.8.0 with MinGW w64 x64 5.4.0. recently. Be sure to check out all following links if you run into problems:
https://wiki.qt.io/Building_Qt_5_from_Git
http://doc.qt.io/qt-5/build-sources.html
https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
https://wiki.qt.io/MinGW
https://wiki.qt.io/Mingw-64-bit
http://doc.qt.io/qt-5/windows-requirements.html#gcc-mingw-builds
http://doc.qt.io/qt-5/supported-platforms-and-configurations.html
http://doc.qt.io/qt-5/windows-building.html
https://wiki.qt.io/Building_Qt_Desktop_for_Windows_with_MinGWIt was only difficult for me because I did not read all that information beforehand. I used OpenSSL 1.0.2k and ICU 57.1 (it is optional, you need MSYS for both of them).
This is a direct link to the toolchain which I used: https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/mingw-builds/5.4.0/threads-posix/seh/
Make sure that it suits you, I remeber that GCC's C++ ABI changed at some 5.x version.
If you still want to try building it with your version try searching for this header in all files of your toolchain - it is required for MinGW build. By the way, the toolchain which I have has this include file inside, no SDK required.
#if defined(Q_CC_MINGW) # define HAS_UI_VIEW_SETTINGS_INTEROP
Thanks for your input. I could overcome this problem with UIViewSettingsInterop.h. This was because the TDM-gcc 5.1 version doesn't have this file in the include directory. Hence I tried using mingw-gcc version 5.4 from the link which you have provided.
Now I have another peculiar problem while compiling q3D module. I am pasting the error message below.
g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++1z -Wall -Wextra -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated-declarations -Wno-unused-function -Wno-reorder -Wvla -Wdate-time -frtti -fexceptions -mthreads -DUNICODE -D_DEBUG -D_CRT_SECURE_NO_WARNINGS -DASSIMP_BUILD_NO_OWN_ZLIB -DASSIMP_BUILD_NO_COMPRESSED_IFC -DASSIMP_BUILD_NO_Q3BSP_IMPORTER -DQT_NO_FOREACH -DQT_PLUGIN -DQT_3DEXTRAS_LIB -DQT_3DRENDER_LIB -DQT_3DINPUT_LIB -DQT_3DLOGIC_LIB -DQT_3DCORE_LIB -DQT_GAMEPAD_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -IC:\Qt\qt580-Src\qt3d\src\plugins\sceneparsers\assimp -I. -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\code -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\code\BoostWorkaround -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\include -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\include\assimp\Compiler -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\contrib\ConvertUTF -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\contrib\irrXML -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\contrib\poly2tri\poly2tri -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\contrib\clipper -IC:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\contrib\unzip -IC:\Qt\qt580-Src\qt3d\include\Qt3DRender\5.8.0 -IC:\Qt\qt580-Src\qt3d\include\Qt3DRender\5.8.0\Qt3DRender -IC:\Qt\qt580-Src\qt3d\include\Qt3DCore\5.8.0 -IC:\Qt\qt580-Src\qt3d\include\Qt3DCore\5.8.0\Qt3DCore -I........\include\Qt3DCore\5.8.0 -I........\include\Qt3DCore\5.8.0\Qt3DCore -IC:\Qt\qt580-Src\qt3d\include -IC:\Qt\qt580-Src\qt3d\include\Qt3DExtras -I........\include -I........\include\Qt3DExtras -IC:\Qt\qt580-Src\qt3d\include\Qt3DRender -I........\include\Qt3DRender -IC:\Qt\qt580-Src\qt3d\include\Qt3DInput -I........\include\Qt3DInput -IC:\Qt\qt580-Src\qt3d\include\Qt3DLogic -I........\include\Qt3DLogic -IC:\Qt\qt580-Src\qt3d\include\Qt3DCore -I........\include\Qt3DCore -IC:\Qt\qt580-Src\qtbase\include\QtGui\5.8.0 -IC:\Qt\qt580-Src\qtbase\include\QtGui\5.8.0\QtGui -IC:\Qt\build-mingw64\qtbase\include\QtGui\5.8.0 -IC:\Qt\build-mingw64\qtbase\include\QtGui\5.8.0\QtGui -IC:\Qt\qt580-Src\qtgamepad\include -IC:\Qt\qt580-Src\qtgamepad\include\QtGamepad -IC:\Qt\build-mingw64\qtgamepad\include -IC:\Qt\build-mingw64\qtgamepad\include\QtGamepad -IC:\Qt\qt580-Src\qtbase\include -IC:\Qt\qt580-Src\qtbase\include\QtGui -IC:\Qt\build-mingw64\qtbase\include -IC:\Qt\build-mingw64\qtbase\include\QtGui -IC:\Qt\qt580-Src\qtbase\include\QtCore\5.8.0 -IC:\Qt\qt580-Src\qtbase\include\QtCore\5.8.0\QtCore -IC:\Qt\build-mingw64\qtbase\include\QtCore\5.8.0 -IC:\Qt\build-mingw64\qtbase\include\QtCore\5.8.0\QtCore -IC:\Qt\qt580-Src\qtbase\include\QtNetwork -IC:\Qt\build-mingw64\qtbase\include\QtNetwork -IC:\Qt\qt580-Src\qtbase\include\QtConcurrent -IC:\Qt\build-mingw64\qtbase\include\QtConcurrent -IC:\Qt\qt580-Src\qtbase\include\QtCore -IC:\Qt\build-mingw64\qtbase\include\QtCore -I.moc\debug -IC:\Qt\qt580-Src\qtbase\mkspecs\win32-g++ -o .obj\debug\IFCReaderGen1.o C:\Qt\qt580-Src\qt3d\src\3rdparty\assimp\code\IFCReaderGen1.cpp
C:/mingw64-w64/bin/../lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/bin/as.exe: .obj\debug\IFCReaderGen1.o: too many sections (40549)Can someone help me in resolving this error? Thanks in advance.
-
Oh, sorry for forgetting to mention that!
This needs a workaround because the output object for this specific source is too big/complex. You need to add
-Wa,-mbig-obj
to the compiler options to overcome that and since Qt does not give any way to feed custom options to compiler I hackedwin32-g++
mkspec to fix this: https://filebin.net/wt5xm89nqulsjtm0 . Overwrite qtbase\mkspecs\qin32-g++\qmake.conf with this.There is probably a better solution to add this to compiler arguments which I am unaware of. I only know that configure script does not have a documented way of doing this.
I do not know whether you will need to reconfigure after doing this, you probably do.
-
Oh, sorry for forgetting to mention that!
This needs a workaround because the output object for this specific source is too big/complex. You need to add
-Wa,-mbig-obj
to the compiler options to overcome that and since Qt does not give any way to feed custom options to compiler I hackedwin32-g++
mkspec to fix this: https://filebin.net/wt5xm89nqulsjtm0 . Overwrite qtbase\mkspecs\qin32-g++\qmake.conf with this.There is probably a better solution to add this to compiler arguments which I am unaware of. I only know that configure script does not have a documented way of doing this.
I do not know whether you will need to reconfigure after doing this, you probably do.
Thanks for your help. Finally I was able to compile Qt5.8 for MingW compiler. I did not make any changes in the spec file, rather I passed the additional options during the configure step as follows
C:\Qt\qt580-Src\configure -prefix "C:\Qt\Qt580" -debug -opensource -shared -opengl desktop -nomake examples -nomake tests -skip qtwebengine -qt-zlib -D ASSIMP_BUILD_NO_OWN_ZLIB -Wa,-mbig-obj
I also had to pass additional define -D ASSIMP_BUILD_NO_OWN_ZLIB so that q3d module could be built successfully.
-
Thanks for your help. Finally I was able to compile Qt5.8 for MingW compiler. I did not make any changes in the spec file, rather I passed the additional options during the configure step as follows
C:\Qt\qt580-Src\configure -prefix "C:\Qt\Qt580" -debug -opensource -shared -opengl desktop -nomake examples -nomake tests -skip qtwebengine -qt-zlib -D ASSIMP_BUILD_NO_OWN_ZLIB -Wa,-mbig-obj
I also had to pass additional define -D ASSIMP_BUILD_NO_OWN_ZLIB so that q3d module could be built successfully.
Very interesting what you did here. I'm having the same problem now.
Can you explain to an amateur like me what you mean by "I also had to pass additional define -D ASSIMP_BUILD_NO_OWN_ZLIB so that q3d module could be built successfully."
Where exactly do you put this line of text? Where is this define written?
-
Very interesting what you did here. I'm having the same problem now.
Can you explain to an amateur like me what you mean by "I also had to pass additional define -D ASSIMP_BUILD_NO_OWN_ZLIB so that q3d module could be built successfully."
Where exactly do you put this line of text? Where is this define written?
@Rapidrain He shows the line needed right here:
C:\Qt\qt580-Src\configure -prefix "C:\Qt\Qt580" -debug -opensource -shared -opengl desktop -nomake examples -nomake tests -skip qtwebengine -qt-zlib -D ASSIMP_BUILD_NO_OWN_ZLIB -Wa,-mbig-obj
So you pass it to the configure for Qt.
-
@Rapidrain He shows the line needed right here:
C:\Qt\qt580-Src\configure -prefix "C:\Qt\Qt580" -debug -opensource -shared -opengl desktop -nomake examples -nomake tests -skip qtwebengine -qt-zlib -D ASSIMP_BUILD_NO_OWN_ZLIB -Wa,-mbig-obj
So you pass it to the configure for Qt.
@ambershark Thank you muchly. I see now it was a configure option.
-
A bit dirty, yet effective solution:
sed -i ‘/^ *# *define *HAS_UI_VIEW_SETTINGS_INTEROP *$/d‘ qtbase/src/plugins/platforms/windows/qwin10helpers.cpp
-
A bit dirty, yet effective solution:
sed -i ‘/^ *# *define *HAS_UI_VIEW_SETTINGS_INTEROP *$/d‘ qtbase/src/plugins/platforms/windows/qwin10helpers.cpp
@Andrej-Debenjak it's not solution even in the slightest sense.