使用Qt Creator交叉编译Qt应用程序的简单方法

Easy way to cross-compile a Qt application using Qt Creator?

本文关键字:Qt 简单 方法 交叉编译 Creator 使用 应用程序      更新时间:2023-10-16

我对这个c++和Qt Creator很陌生,我在Mac OS X中使用Qt Creator。有一个简单的方法来编译Windows和Linux平台吗?目前我正在做的是将源文件复制到Windows机器上(使用Qt)并编译它,这需要很多时间。

是否有一个命令或其他东西可以一次获得所有3个可执行文件?

它不支持开箱,你可能会在不同的味道之间混淆

对于这样的目标,我强烈建议:

- to use either centralised (svn) or distributed (git, hg) SCM
- to use continuus integration with 3 agents, each one in a different platform (can be VM or physical computer).  You can use hudson or cruise control

:

- you develop locally, on whatever platform you prefer
- you push / commit / submit your changes
- the buildbox compiles on all platforms (while you can still work on the next feature)
- ideally, you run your unit tests as well
- once all builds on all platforms are finished, you got a status and a build on all targets

当想要处理多个版本的Qt或编译器时,这是相当有用的:返回值绝对值得在设置中投入时间(并且它可以很好地伸缩)

这远非微不足道,Trolltech不喜欢这个想法(因为它比它应该的更难)。

交叉编译Qt/Win应用程序在Linux上在互联网上,这将有助于(只有目录可能与Mac不同,命令应该是相同的)。

交叉编译完成后,您需要创建一个Qt Creator的快捷方式,使用自定义PATH,将交叉编译器目录附加到PATH的其余部分。这样你就可以确保它被使用了。但不建议这样做。

为什么不直接使用正确设置的VM?