QT Creator - 跨平台编译 [英] QT Creator - cross platform compiling

查看:212
本文介绍了QT Creator - 跨平台编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译Windows,Mac和Linux!

Compiling for Windows, Mac and Linux!

是唯一的方法做到这一点....是在每个操作系统上安装QT Creator,并编译自己的版本?

Is the only way to do this.... is to install QT Creator on each OS and compile its own version?

(目前在Mac OSX下正在运行QT Creator)

(Currently running QT Creator under Mac OSX)

推荐答案

Qt Creator只是自动化工具,它将为您创建Makefile和相邻文件。

Qt Creator is just the automation tool, it will create Makefile and adjacent files for you.

如果要交叉编译,只需扩展Makefile,交叉编译,例如:

If you want to cross-compile, simply extend your Makefile so it could be possible to cross-compile, for example, via:

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

a href =http://wiki.amule.org/wiki/Cross-compilation_for_windows_with_mingw =nofollow>此处。请注意,您需要为每个目标(包括库)提供完整的工具链。这是一个单独的主题,但希望有一大堆文章在那里。 Btw,大多数Linux发行版都有mingw32工具链,我相信也应该有一个OSX。

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.

此外,你可能对 tmake - 它最初是为了自动生成Makefile来构建Qt。

Also, you might be highly interested in tmake - it was originally developed to autogenerate Makefiles for building Qt.

这篇关于QT Creator - 跨平台编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆