简体   繁体   English

QT Creator-跨平台编译

[英]QT Creator - cross platform compiling

Compiling for Windows, Mac and Linux! 适用于Windows,Mac和Linux!

Is the only way to do this.... is to install QT Creator on each OS and compile its own version? 是这样做的唯一方法...。是在每个OS上安装QT Creator并编译自己的版本吗?

(Currently running QT Creator under Mac OSX) (当前在Mac OSX下运行QT Creator)

Qt Creator is just the automation tool, it will create Makefile and adjacent files for you. Qt Creator只是自动化工具,它将为您创建Makefile和相邻文件。

If you want to cross-compile, simply extend your Makefile so it could be possible to cross-compile, for example, via: 如果您想交叉编译,只需扩展您的Makefile,以便可以交叉编译,例如,通过:

export TARGET=i686-mingw32
CXX=$TARGET-g++ RANLIB=$TARGET-ranlib AR=$TARGET-ar make -f Makefile.mingw

Reference is here . 参考在这里 Please note, you will need to have entire toolchain for every target, including libraries. 请注意,您将需要为每个目标(包括库)拥有完整的工具链。 This is a separate topic, but hopefully there is a whole bunch of articles out there. 这是一个单独的主题,但希望那里有很多文章。 Btw, most Linux distro's have mingw32 toolchain available, and I believe there should be one for OSX too. 顺便说一句,大多数Linux发行版都有mingw32工具链可用,我相信OSX也应该有一个。

Also, you might be highly interested in tmake - it was originally developed to autogenerate Makefiles for building Qt. 另外,您可能对tmake很有兴趣-它最初是为自动生成用于构建Qt的Makefile而开发的。

Qt Creator is only an IDE, not a compiler. Qt Creator只是一个IDE,不是编译器。 You can configure it to use whatever compiler you like, including a cross-compiler (for instance GCC cross-compiler ). 您可以将其配置为使用所需的任何编译器,包括交叉编译器(例如GCC cross-compiler )。

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

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