首页 文章

如何构建Qt 5.7.0进行交叉编译?

提问于
浏览
1

如何在Ubuntu上构建Qt 5.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/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 .

1 回答

  • 0

    不确定这是否是正确的修复,但似乎Qt尝试在ActiveQt(仅限Windows)下构建其中一个工具作为本机 .

    在这里我编辑了这个文件:

    qtactiveqt/src/tools/idc/idc.pro

    并且注释了两个第一行,这似乎解决了这个问题 .

    (我也确实将binfmt配置为通过wine运行.exe文件,这可能会影响它是否尝试将idc工具作为本机工具运行)

相关问题