我应该在 Linux 还是 Windows 中交叉编译?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1025687/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:41:08  来源:igfitidea点击:

Should I cross-compile in Linux or Windows?

windowslinuxqtcross-compiling

提问by suse

To create a .exein Linux using Qt SDK, should I cross compile my application in Linux or cross-compile my application in Windows?

.exe使用 Qt SDK 在 Linux 中创建一个,我应该在 Linux 中交叉编译我的应用程序还是在 Windows 中交叉编译我的应用程序?

回答by jrharshath

You need to cross compile onLinux, forwindows.

对于Windows ,您需要Linux进行交叉编译。

EDIT:

编辑:

  1. install MinGW on Linux.
  2. cross-compileyour Qt code on Linux. A windows binary (.exe) should be produced.
  3. You are done. Happily execute the exe on any windows system with Qt runtime libraries.
  1. Linux上安装 MinGW 。
  2. Linux交叉编译你的 Qt 代码。应生成Windows 二进制文件 ( .exe)。
  3. 你完成了。在任何带有 Qt 运行时库的 Windows 系统上愉快地执行 exe。

Hope that clears things up.

希望这能说明问题。

jrh

jrh

回答by Alan Haggai Alavi

Either cross-compilein Linux, or compilein Windows.

要么在 Linux 中交叉编译,要么在 Windows 中编译

回答by rasjani

First off, kvg. Google search for "cross-compiling qt applications in linux for windows" and first link that comes up is this: http://silmor.de/29

首先,kvg。谷歌搜索“在 linux for windows 中交叉编译 qt 应用程序”,出现的第一个链接是:http: //silmor.de/29

The steps should be simple:

步骤应该很简单:

  • install mingw
  • install qt linux binaries so that you get qmake and moc and other stuff needed for compilation.
  • get windowsqt binaries and other possible libraries your application requires.
  • create a new qmake configuration files (see silmor.de page for more details)
  • go to your source folder and call qmake -spec $SpecFileCreatedInStep4
  • make
  • profit!!
  • close your questions in so.
  • 安装 mingw
  • 安装 qt linux 二进制文件,以便获得 qmake 和 moc 以及编译所需的其他东西。
  • 获取您的应用程序需要的windowsqt 二进制文件和其他可能的库。
  • 创建一个新的 qmake 配置文件(更多细节见 silmor.de 页面)
  • 转到您的源文件夹并调用 qmake -spec $SpecFileCreatedInStep4
  • 制作
  • 利润!!
  • 关闭你的问题。