1

Good day all

I have been searching for a method of cross-compiling for QT-Creator in Linux for sometime now, and I have been having alot of trouble with it.

Background info

please note: I am on a Linux machine, and would like to cross compile Windows Apps

My system:

  • Ubuntu Gnome 16.10
  • QT Creator 4.0.2 (based on QT 5.7)

I have came across a few SO links, a few blogs with broken instructions, etc and one seeming helpful but dependencies could not be found.

I have also attempted another compiler MXE and cloned and attempted to build the MXE compiler from the GIT repo, which failed (no solution for the build error - VTK build error)

I decided to download precompiled MinGW compilers (i686 and x86_x64 versions) from sourceforge

Issue:

In QT Creator, adding the compiler is done without an issue, adding the "Kit" and selecting the newly added compiler, an red exclamation gives an error

The Compiler (x86_windows_msys_pe_64bit) cannot produce code for QT version 5.7.0 GCC 64Bit (x86_linux_generic_elf_64bit)

This occurs for both 32 + 64 bit compilers.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
CybeX
  • 2,060
  • 3
  • 48
  • 115

1 Answers1

0

I think that you should have a QT version that matches your compiler ABI. The error tells you that the MinGW compiler doesn't match the Linux version of QT you have used. Therefore, get a windows version of QT and use it instead (just as you've added WinGW).

You can download Qt Binaries from here.

Shmuel H.
  • 2,348
  • 1
  • 16
  • 29
  • thank you for the response, I have GCC 6 install, and the MinGW compiler uses `x86_64-w64-mingw32-gcc (GCC) 6.2.0 20160822`, although QT-Creator uses GCC 4.9, if QT-Creator 4.0.2 (based on QT 5.7) uses GCC 4.9, should I attempt at building QT-Creator 4.0.2 with GCC 6 ? – CybeX Nov 13 '16 at 07:00
  • @KGCybeX You should get a windows version of Qt. If you want, you can build Qt for Windows with MinGW and use it. – Shmuel H. Nov 13 '16 at 07:06
  • That is exactly what I didn't want, I would like to compile `.exe`'s within Linux, thus avoid booting into Windows. – CybeX Nov 13 '16 at 16:47
  • @KGCybeX No, you should have Qt libraries for windows on Linux in order to compile a Qt program for Windows. – Shmuel H. Nov 13 '16 at 17:04
  • thank you for the advice, to conclude, any idea how I should include the libraries? Should I place them in the relevant linux directories (same dir as linux lib for each respective windows lib) or should this be added to the compiler lib structure? – CybeX Nov 13 '16 at 20:48
  • @KGCybeX Try to add it as a Qt version (almost the same way as adding the MinGW compiler). – Shmuel H. Nov 13 '16 at 20:53