QT Creator - cross platform compiling

2019-05-26 03:50发布

Compiling for Windows, Mac and Linux!

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

(Currently running QT Creator under Mac OSX)

2条回答
smile是对你的礼貌
2楼-- · 2019-05-26 04:04

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

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

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.

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

查看更多
神经病院院长
3楼-- · 2019-05-26 04:04

Qt Creator is only an IDE, not a compiler. You can configure it to use whatever compiler you like, including a cross-compiler (for instance GCC cross-compiler).

查看更多
登录 后发表回答