setup qtcreator kit for cross compiling (mxe)

2.4k views Asked by At

I'm trying setup an environment to cross-compile my projects from ubuntu to windows. Looking around I managed to compile qt through mxe, now the problem is I can't get it to work inside qtcreator. Being specific, I added in QtVersion tab

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

which has the following attributes

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

I tried to add every file in ../mxe/usr/bin directory as compiler but I always receive the same msg: "The compiler xxxxxx cannot produce code for this QT version" Note that I simply gave make qt5, without arguments...

ps of course I set the "new" qt version also in the kit tab

1

There are 1 answers

2
dursunturan On

Open QtCreator and go to Tools->Options->Build&Run->Compilers menu then change the default ABI value of installed appropriate compiler to what you see in the spec output of the toolchain: x86-unknown-unknown-32bit to x86-windows-unknown-pe-32bit.