简体   繁体   中英

Cross-compiling in Eclipse CDT with Qt under Mac OSX

Let me list all that I have setup:

OS: Mac OSX - 10.6.8

IDE: Eclipse CDT Indigo

Framework: Qt 4.7.2

As known, the Qt doesn't have integration to Eclipse on Mac, so I installed everything using this tutorial here: http://www.hyper-world.de/en/2009/05/13/qt-and-eclipse-under-mac-os-x/

I was able to compile a simple program to MacOS without a problem.

The issue here is that I need to cross compile my apps to Windows and to Linux. But I'm new to cross compiling, so I need some directions:

  1. I used this cross compilers for MacOS here: http://crossgcc.rts-software.org/doku.php . Do you guys think that is the best approach?

  2. I currently using automatically generated makefiles from Eclipse. Can Eclipse generate, from a single project, 3 different OSs outputs without using external make builders?

  3. If I send to another developer this project, can he compile it under Windows or Linux (Ubuntu)?

  4. If a step-by-step tutorial can be provided for that or any sample project files for Eclipse with this configs, I appreciate.

I may not help you with all you asked. Buf have you heard of cmake? if you use cmake in your project, it will work everywhere. It generates the makefiles for you. Take a look: http://www.vtk.org/Wiki/CMake_Cross_Compiling .

CMake finds the location of libraries, it linkes your code. About QT, it also can moc the Q_OBJECT files so you don't have to worry about it.

We develop a full cross-platform Qt application, and deploy on Windows, OSX, and 32-bit and 64-bit Linux.

In my experience there is not an easy way to do "it just works" cross platform builds. What we do is literally build on dedicated OS-specific machines (you could use VMs too). This is not a trivial undertaking either of course. CMake might be a great way to try and unify the project so it'll build on all platforms, and possibly use Eclipse "on the side" (or if it works with CMake, even better). We like to use Visual Studio, so we ended up writing a bunch of scripts to do the builds on the other machines.

We had to use C++/Qt because of our need for hardware access and speed; if your needs are different there are much easier solutions to go cross platform, such as Adobe Air.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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