PDA

View Full Version : cross platform basics



tommy
8th February 2008, 15:53
I have written a program under Windows environment and now I'd like to compile the source for Linux, Unix, Mac-OS (or at least some of them, most importantly Mac). The problem is that I only know windows and I don't know ANYTHING about the others. This leads me to asking some basic and boring questions:

1. I know Qt code is cross platform. Are there any modifications in the code you have to make to compile for other platforms? (Apart from the obvious, like "never use right mouse button on Mac").

2. Do I really have to aquire a separate computer for each type of compilation? Can my windows machine compile for other platforms? If yes, what needs to be done? My plan is to compile all of them statically.

3. Is there anything Mac-, Unix-, Linux-specific about Qt4.3.3 that I should be aware of? Any pitfalls that you guys are aware of?

4. Windows version of Qt uses MingW. What about the other platforms?

Thanks a lot!

wysota
8th February 2008, 19:16
1. I know Qt code is cross platform. Are there any modifications in the code you have to make to compile for other platforms?
No.


(Apart from the obvious, like "never use right mouse button on Mac").
Why not? What if I attach a 12 button mouse to a Mac? :)


2. Do I really have to aquire a separate computer for each type of compilation?
In theory no.

Can my windows machine compile for other platforms?
In theory yes.

If yes, what needs to be done? My plan is to compile all of them statically.
Google for "crosscompiling".


3. Is there anything Mac-, Unix-, Linux-specific about Qt4.3.3 that I should be aware of? Any pitfalls that you guys are aware of?
Not really. Just forget your Windows habits and let Qt worry about details.



4. Windows version of Qt uses MingW. What about the other platforms?
Actually you can use various compilers. For Windows the two most frequently used are MSVC and MinGW, for other platforms GCC has a dominant position.

http://doc.trolltech.com/4.3/compiler-notes.html