Important: Please read the Qt Code of Conduct -

Linux to Windows cross-compiling error using Qt5 and MinGW

  • Hello !

    I'm trying to setup Qt5 to build executables for Windows on my Linux computer.
    It looks like my QMAKE_SEP_DIR is messing things up.

    Here are the steps I followed :

    • I installed Qt5 and MinGW, fo r Linux
    • I installed Qt5, Windows version (msvc2010), using Wine
    • I created/copied an mkspec for my build target (win32-x-g++)

    inside my mkspec's qmake.conf , I defined :

    • QMAKE_COPY and such to be DOS-like (I even tried to set QMAKE_SH)
    • the path to my Qt5 include and lib dirs : /home/[myuser]/.wine/drive_c/Qt/Qt5.0.0/5.0.0/msvc2010/include and [blahblah]/lib (files are OK)

    and, last but not least, my QMAKE_DIR_SEP, which seems to be the real issue : if I use / (Linux-wise), make will return an error stating :
    i586-mingw32msvc-g++: /LIBPATH:C:QtQt5. file not found (look at the path reported!)

    If I change my QMAKE_DIR_SEP to anything like a backslash, then the compiler can't find any Qt include files.

    Am I doing something wrong, or missing something obvious?
    I'm stuck with this for a while, and any help would be really appreciated.

  • Moderators

    You can not link object files build with mingw to msvc2010 libraries. I am afraid you will need to build Qt with mingw for this to work.

Log in to reply