C++ 如何为交叉编译构建Qt5.7.0?
如何在Ubuntu上构建Qt5.7.0,以便交叉编译到Windows 我有一个错误:C++ 如何为交叉编译构建Qt5.7.0?,c++,linux,qt5,cross-compiling,C++,Linux,Qt5,Cross Compiling,如何在Ubuntu上构建Qt5.7.0,以便交叉编译到Windows 我有一个错误: In file included from qt-everywhere-opensource-src-5.7.0/qtbase/include/QtCore/qt_windows.h:1:0, from main.cpp:33: qt-everywhere-opensource-src-5.7.0/qtbase/include/QtCore/../../src/corelib/glob
In file included from qt-everywhere-opensource-src-5.7.0/qtbase/include/QtCore/qt_windows.h:1:0,
from main.cpp:33:
qt-everywhere-opensource-src-5.7.0/qtbase/include/QtCore/../../src/corelib/global/qt_windows.h:61:21: fatal error: windows.h: No such file or directory
我的配置选项:
./configure -opensource -c++std c++11 -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- -device-option PKG_CONFIG=i686-w64-mingw32-pkg-config -force-pkg-config -prefix /opt/qt/qt-5.7.0-win32 -nomake examples
windows.h有路径:/usr/i686-w64-mingw32/include/windows.h
注意:我不想使用MXE。不确定这是否是正确的修复方法,但Qt似乎试图将ActiveQt(仅限Windows)下的一个工具构建为本机工具 我在这里编辑了这个文件: qtactiveqt/src/tools/idc/idc.pro 并注释掉了前两行,这似乎解决了问题
(我也将binfmt配置为通过wine运行.exe文件,这可能会影响它是否尝试将idc工具作为本机工具运行)不确定这是否是正确的修复方法,但Qt似乎试图将ActiveQt下的一个工具(仅限Windows)构建为本机工具 我在这里编辑了这个文件: qtactiveqt/src/tools/idc/idc.pro 并注释掉了前两行,这似乎解决了问题 (我也将binfmt配置为通过wine运行.exe文件,这可能会影响它是否尝试将idc工具作为本机工具运行)