I'm looking for a C++ compiler that can compile for Linux, Windows, and Mac. Is there any compiler that can do this?
Three answers:
jplatt39
2010-06-28 15:29:34 UTC
GCC ships with most versions of Linux natively -- the kernel requires its glibc libraries to run. Apple will provide it to anyone who registers as a developer. For Windows you can get it and supporting libraries through either the mingw or cygwin packages. Since they are different operating systems you will have to compile them separately for each os -- this is especially true since Apple and apple compilers support both Intel and PowerPC chips, while Linux supports Intel, PowerPC, Cell and arm chips and many others. GCC will compile for them all.
You can compile the same code for all three platforms. It will link to different libraries. So try it.
http://gcc.gnu.org
anonymous
2016-06-04 04:28:34 UTC
C++ compilers that are also C compilers, and most are, can compile C code. Dev c++ is a wrapper around the GCC compiler suite which includes both C and C++ front ends.
speedy3517
2010-06-28 15:21:46 UTC
According to wikipedia, gcc can do cross-compile, you need to set the --target= option and have the proper binutils.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.