Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Error Cross Compile Qt 5.6.0 Linux Host to Windows
Forum Updated to NodeBB v4.3 + New Features

Error Cross Compile Qt 5.6.0 Linux Host to Windows

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    estanisgeyer
    wrote on last edited by
    #1

    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

    Marcelo Estanislau Geyer
    Standard Net Tecnologia / Brazil

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • E Offline
        E Offline
        estanisgeyer
        wrote on last edited by
        #3

        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.

        Marcelo Estanislau Geyer
        Standard Net Tecnologia / Brazil

        1 Reply Last reply
        0
        • E Offline
          E Offline
          estanisgeyer
          wrote on last edited by
          #4

          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,

          Marcelo Estanislau Geyer
          Standard Net Tecnologia / Brazil

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved