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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

6 Comments

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 ?
@KGCybeX You should get a windows version of Qt. If you want, you can build Qt for Windows with MinGW and use it.
That is exactly what I didn't want, I would like to compile .exe's within Linux, thus avoid booting into Windows.
@KGCybeX No, you should have Qt libraries for windows on Linux in order to compile a Qt program for Windows.
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?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.