Obviously you can't really run Mac or Linux apps on Windows, but can you compile binaries for those platforms using MSVC++ for example (plugging in additional compilers and tools obviously)? For a serious build system, you don't want one build server per platform so having an automated build server which compiles for all target platforms seems quite a reasonable aim.
-
1A build server hosting a number of VMs is quite a standard approach now. – SK-logic Feb 13 '11 at 14:55
-
1That's a good point, I hadn't thought of it. But you can't virtualize Macs (legally), can you? – Mr. Boy Feb 13 '11 at 15:34
-
1AFAIK the only legal way to virtualize a Mac is to host the virtual Mac on a real Mac. So if you don't mind having a Mac (with gobs of RAM) as your build server, you can get an all-in-one-machine build process that way. – Jeremy Friesner Feb 13 '11 at 17:24
-
@John: how I understand Apple's terms: you are allowed to virtualize Mac OS on Mac hardwware, ie if the VM runs on Mac hardware (read: over-priced white plain hardware), you are allowed to run Mac OS in the VM. Does it help you? Probably not, because you'd still need a Mac, and why vitualize what you've then lready got `;)` – rubenvb Feb 13 '11 at 17:25
-
Suppose you can run a Mac and then virtualize Windows/Linux on it, but I don't consider Mac Server to be sensible, aren't they phasing it out? – Mr. Boy Feb 14 '11 at 09:26
-
also see: http://stackoverflow.com/questions/4769968/c-cross-compiler-from-windows-to-linux – Martin Ba Feb 14 '11 at 14:38
3 Answers
Crosstool-NG seems like your best option for Linux apps; they show that as one of the standard configurations. I do not know about Mac OS X; this question suggests that it will probably be difficult.

- 1
- 1

- 30,161
- 7
- 76
- 78
I would like to believe (notice my careful words) that GCC can be built to run on windows (any relevant form of the triplet --mingw*) and target another triplet.
A proof-of-concept for the non-believers is provided here, where you can find Win64 hosted compilers that build native linux binaries. I assume the same can be done for mac if the necessary libraries (like the CRT and necessary Mac framework libraries) can be built/used by that compiler.

- 74,642
- 33
- 187
- 332
-
I'd like to believe it too... as I say originally, technically it should be _possible_... – Mr. Boy Feb 14 '11 at 09:25
if you want to build applications using C++
, why not use Qt
from Nokia. it's cross platform. http://qt.nokia.com/

- 74,642
- 33
- 187
- 332

- 1,355
- 1
- 10
- 13
-
2Qt is an application framework, ie a library with associated tools and code style and preferred classes. Qt or not is irrelevant here, more so because Qt disallows/disencourages cross-compilation. – rubenvb Feb 13 '11 at 17:19