设置用于交叉编译的qtcreator工具包(mxe)

时间:2014-12-09 11:23:07

标签: qt qt-creator cross-compiling mxe

我正在尝试设置一个环境,将我的项目从ubuntu交叉编译到windows。 环顾四周我设法通过mxe编译qt,现在的问题是我无法让它在qtcreator中运行。 具体而言,我在QtVersion标签中添加了

/home/user_name/mxe/usr/i686-w64-mingw32.static/qt5/bin/qmake

具有以下属性

Name: Qt 5.4.0 (qt5)
ABI: x86-windows-unknown-pe-32bit
Source: /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5
mkspec: win32-g++
qmake: /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/bin/qmake
Version: 5.4.0
QMAKE_SPEC linux-g++
QMAKE_VERSION 3.0
QMAKE_XSPEC win32-g++
QT_HOST_BINS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/bin
QT_HOST_DATA /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5
QT_HOST_LIBS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/lib
QT_HOST_PREFIX /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5
QT_INSTALL_ARCHDATA /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5
QT_INSTALL_BINS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/bin
QT_INSTALL_CONFIGURATION /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/etc/xdg
QT_INSTALL_DATA /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5
QT_INSTALL_DEMOS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/examples
QT_INSTALL_DOCS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/doc
QT_INSTALL_EXAMPLES /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/examples
QT_INSTALL_HEADERS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/include
QT_INSTALL_IMPORTS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/imports
QT_INSTALL_LIBEXECS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/bin
QT_INSTALL_LIBS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/lib
QT_INSTALL_PLUGINS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/plugins
QT_INSTALL_PREFIX /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5
QT_INSTALL_QML /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/qml
QT_INSTALL_TESTS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/tests
QT_INSTALL_TRANSLATIONS /home/snake91/mxe/usr/i686-w64-mingw32.static/qt5/translations
QT_SYSROOT
QT_VERSION 5.4.0

我尝试将../mxe/usr/bin目录中的每个文件添加为编译器,但我总是收到相同的消息:“编译器xxxxxx无法为此QT版本生成代码” 请注意,我只是给了make qt5,没有参数...

ps当然我也在套件标签中设置了“新”qt版本

1 个答案:

答案 0 :(得分:2)

打开QtCreator并转到Tools->Options->Build&Run->Compilers菜单,然后将安装的相应编译器的默认ABI值更改为您在工具链的规范输出中看到的值: x86-unknown-unknown-32bit x86- windows -unknown- pe -32bit