Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
5.15.0
-
None
-
clang 8.0.0
mingw64 7.0
Description
Hi,
I am currently trying to cross compile qt 5.15 from linux to windows.
qtbase compiles without much trouble but I encounter some issues while compiling qtdeclarative.
qmltyperegistrar seems to be a required tool in this version but it fails to compile as it uses the headers from the target build, so it ends up using headers that are incompatible with the host enviroment (here it uses pthread.h which is made for windows).
qtbase host_tools compiles without any problem.
previous version had the same issue with other tools (qmlcachegen for instance), but this was a non issue as theses tools are optional to get a functional version of Qt.
compilation output:
cd qmltyperegistrar/ && ( test -e Makefile || /vlc/contrib/x86_64-w64-mingw32/host/bin/qmake -o Makefile /vlc/contrib/contrib-win64/qtdeclarative/src/qmltyperegistrar/qmltyperegistrar.pro ) && make -f Makefile make[2]: Entering directory '/vlc/contrib/contrib-win64/qtdeclarative/src/qmltyperegistrar' g++ -c -pipe -O2 -std=c++11 -fno-exceptions -Wall -Wextra -ffunction-sections -fdata-sections -D_REENTRANT -fPIC -DQT_NO_LINKED_LIST -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_BOOTSTRAP_LIB -DQT_VERSION_STR='"5.15.0"' -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=15 -DQT_VERSION_PATCH=0 -DQT_BOOTSTRAPPED -DQT_NO_CAST_TO_ASCII -I. -I../../tools/shared -I/vlc/contrib/x86_64-w64-mingw32/include -I/vlc/contrib/x86_64-w64-mingw32/include/QtCore -I/vlc/contrib/x86_64-w64-mingw32/include/QtCore/5.15.0 -I/vlc/contrib/x86_64-w64-mingw32/include/QtCore/5.15.0/QtCore -I/vlc/contrib/x86_64-w64-mingw32/include/QtXml -I/vlc/contrib/x86_64-w64-mingw32/include/QtXml/5.15.0 -I/vlc/contrib/x86_64-w64-mingw32/include/QtXml/5.15.0/QtXml -I/vlc/contrib/x86_64-w64-mingw32/host/mkspecs/linux-g++ -o .obj/resourcefilemapper.o ../../tools/shared/resourcefilemapper.cpp In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/9/bits/gthr.h:148, from /usr/include/c++/9/ext/atomicity.h:35, from /usr/include/c++/9/bits/basic_string.h:39, from /usr/include/c++/9/string:55, from /vlc/contrib/x86_64-w64-mingw32/include/QtCore/qbytearray.h:52, from /vlc/contrib/x86_64-w64-mingw32/include/QtCore/qstring.h:50, from /vlc/contrib/x86_64-w64-mingw32/include/QtCore/qhashfunctions.h:44, from /vlc/contrib/x86_64-w64-mingw32/include/QtCore/qlist.h:47, from /vlc/contrib/x86_64-w64-mingw32/include/QtCore/qstringlist.h:41, from /vlc/contrib/x86_64-w64-mingw32/include/QtCore/QStringList:1, from ../../tools/shared/resourcefilemapper.h:31, from ../../tools/shared/resourcefilemapper.cpp:29: /vlc/contrib/x86_64-w64-mingw32/include/pthread.h:66:10: fatal error: process.h: No such file or directory 66 | #include <process.h> | ^~~~~~~~~~~ compilation terminated.
qt-base is configured with:
CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" CCAS="x86_64-w64-mingw32-gcc -c" RANLIB="x86_64-w64-mingw32-ranlib" STRIP="x86_64-w64-mingw32-strip" PATH="/vlc/contrib/x86_64-w64-mingw32/bin:/vlc/extras/tools/build/bin:/vlc/extras/tools/build/bin/:/opt/llvm-mingw/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" PKG_CONFIG="pkg-config" CPPFLAGS=" -I/vlc/contrib/x86_64-w64-mingw32/include" CFLAGS=" -I/vlc/contrib/x86_64-w64-mingw32/include -g -O0" CXXFLAGS=" -I/vlc/contrib/x86_64-w64-mingw32/include -g -O0" LDFLAGS=" -L/vlc/contrib/x86_64-w64-mingw32/lib " DXSDK_DIR=/vlc/contrib/x86_64-w64-mingw32/bin ./configure -xplatform win32-clang-g++ -device-option CROSS_COMPILE=x86_64-w64-mingw32- -static -no-shared -opensource -confirm-license -no-pkg-config -no-sql-sqlite -no-gif -qt-libjpeg -no-openssl -angle -no-dbus -no-vulkan -no-sql-odbc -no-pch -no-compile-examples -nomake examples -nomake tests -qt-zlib -skip qtsql -release -no-direct2d -prefix /vlc/contrib/x86_64-w64-mingw32 -I /vlc/contrib/x86_64-w64-mingw32/include
Note that I tried to set the host tools in a different tree (using -hostprefix if I remember correctly), but this doesn't changes the outcome.
qtdeclarative is configured with:
/vlc/contrib/x86_64-w64-mingw32/bin/qmake -- -no-feature-qml-debug -no-feature-quick-designer
for reference, my script to build Qt 5.15 is here:
https://code.videolan.org/chub/vlc/-/tree/qt5.15/contrib/src/qt