简体   繁体   English

QT启用使用MinGW进行交叉编译(预编译)

[英]QT enable cross-compiling using MinGW (precompiled)

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. 我一直在寻找一种在Linux中交叉编译QT-Creator的方法,而且我一直有很多麻烦。

Background info 背景信息

please note: I am on a Linux machine, and would like to cross compile Windows Apps 请注意:我在Linux机器上,并希望交叉编译Windows应用程序

My system: 我的系统:

  • Ubuntu Gnome 16.10 Ubuntu Gnome 16.10
  • QT Creator 4.0.2 (based on QT 5.7) QT Creator 4.0.2(基于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. 我发现了一些SO 链接 ,一些破坏了指令的博客等等, 其中一个看起来很有帮助,但无法找到依赖关系。

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) 我也尝试另一个编译器MXE和克隆,并尝试从GIT建立MXE编译回购 ,其中失败(生成错误无解- VTK建立自己的错误)

I decided to download precompiled MinGW compilers (i686 and x86_x64 versions) from sourceforge 我决定从sourceforge下载预编译的MinGW编译器 (i686和x86_x64版本)

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 在QT Creator中,添加编译器没有问题,添加“Kit”并选择新添加的编译器,红色感叹号出错

The Compiler (x86_windows_msys_pe_64bit) cannot produce code for QT version 5.7.0 GCC 64Bit (x86_linux_generic_elf_64bit) 编译器(x86_windows_msys_pe_64bit)无法为QT版本5.7.0 GCC 64Bit(x86_linux_generic_elf_64bit)生成代码

This occurs for both 32 + 64 bit compilers. 32 + 64位编译器都会出现这种情况。

I think that you should have a QT version that matches your compiler ABI. 我认为你应该有一个与编译器ABI相匹配的QT版本。 The error tells you that the MinGW compiler doesn't match the Linux version of QT you have used. 该错误告诉您MinGW编译器与您使用的Linux版本的QT不匹配。 Therefore, get a windows version of QT and use it instead (just as you've added WinGW). 因此,获取一个Windows版本的QT并使用它(就像你添加了WinGW一样)。

You can download Qt Binaries from here . 您可以从这里下载Qt Binaries。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM