Error Cross Compile Qt 5.6.0 Linux Host to Windows



  • Hello,

    I'm trying to compile Qt 5.6.0 on Linux to use cross compile with target for Windows, but I have the following problem:

    $ ./configure -prefix /home/marcelo/mingw64/usr/local/Qt5 -nomake examples -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32-
    ...

    $ make -j5
    ...

    $ sudo make install
    ...
    make[4]: Entrando no diretório `/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtactiveqt/src/tools/idc'
    g++ -c -pipe -g -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_USE_QSTRINGBUILDER -DQT_NO_EXCEPTIONS -DQT_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -I. -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0 -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0/QtCore -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtXml -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtXml/5.6.0 -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtXml/5.6.0/QtXml -I/home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/linux-g++ -o .obj/main.o main.cpp
    In file included from /home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/qt_windows.h:1:0,
    from main.cpp:38:
    /home/marcelo/mingw64/downloads/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/../../src/corelib/global/qt_windows.h:63:21: fatal error: windows.h: File or directory not found
    #include <windows.h>
    ^
    compilation terminated.
    make[4]: ** [.obj/main.o] Error 1

    All help is welcome, thanks
    Marcelo


  • Lifetime Qt Champion

    Hi,

    Silly question but do you have that header file somewhere installed where Qt also is ?



  • This header file "windows.h" is in /usr/i686-w64-mingw32/include.
    With Qt 4.8.6 I compile this way and it worked perfectly.



  • I solved the problem by disabling the Qt modules qtactiveqt and qtmultimedia:

    $ ./configure -prefix /home/marcelo/mingw64/usr/local/Qt5 -nomake examples -nomake tests -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- -skip qtactiveqt -skip qtmultimedia

    $ make -j4
    $ sudo make install

    Thanks,


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.