Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

linuxftw

macrumors newbie
Original poster
Jun 25, 2007
10
0
I have recently been considering switching to Mac. I have done a lot of C, C++ and java, compiling on linux/windows. Could somebody explain to me briefly which compilers, libraries, programming tools etc you use on OSX.
 

ChrisA

macrumors G5
Jan 5, 2006
12,911
2,157
Redondo Beach, California
I have recently been considering switching to Mac. I have done a lot of C, C++ and java, compiling on linux/windows. Could somebody explain to me briefly which compilers, libraries, programming tools etc you use on OSX.

First off, anything that would work under Linux should work under Mac OS X. After all Mac OSX just UNIX with a graphical desktop running. But the Mac does add a development system cal Xcode that offers drage and drop user interface development and other graphical tool. But under it all Xcode uses the GNU tool set same as Linuix.

If you want to build Mac applications Xcode is a self-contained system and you don't have to know it is using gcc.
 

MacRohde

macrumors regular
Jun 1, 2004
164
0
Copenhagen, Denmark
Good evening.

I'm a Windows programmer at day but at night I shed my hide and program on the Mac, and here's what I have to say on the subject:

Regarding C/C++ there's the GNU compiler set just as on Linux (they are also available on Windows as Mingw as you probably know). So, for C and C++ you're all set.

For GUI development using C++ you can use Qt, and for GUI development using C you can use Carbon which is an Apple provided API. Carbon is mainly a transitional API though - it was developed for developers who needed to get their Mac OS applications to run on Mac OS X back when Apple made the Mac OS -> OS X transition and such applications were said to be "Carbonized" - but it's a fully functional API.

Many of the lower APIs on Mac OS X is also C APIs, and since Mac OS X is Unix underneath there's also access to all the different Unix/Linux frameworks. You can even get X Windows on OS X!

Regarding Java, Apple and not Sun supplies the runtime and the SDK. The Apple Java version is always a little late compared to both Windows and Linux, and Apple has the nasty habit of making you upgrade if you want the latest Java version! As of now there's Java version 5 for Tiger, but AFAIK Java version 6 is slated to be a Leopard only thing! Other than that Java works fine on Mac OS X and obviously all the Java IDEs like Eclipse and Netbeans can run on the Mac.

If you really want to do native applications development on the Mac you should look into Objective-C and Cocoa. Objective-C is C with objects just like C++ but much much closer to C than C++. If you know some basic C and some OOP principles you can learn Objective-C in a few hours. It's a very powerful language (you can find a small booklet on ADC describing the language - it's quite good). Cocoa is the Objective-C API used for writing native desktop applications on the Mac. It's a very nice API to work with and utilizes some principles which are very foreign for a native Windows developer.

You would use Xcode and Interface Builder for Objective-C/Cocoa development and Xcode for other C++/C development (Xcode uses the GNU tool set). Both programs are free from Apple and come on you install CD/DVD; they can also be downloaded for free from ADC. Save for Java you would basically use Xcode for most development on the Mac.

Other than that all the usual scripting languages also work on the Mac (Python, Ruby, Perl etc.).
 

linuxftw

macrumors newbie
Original poster
Jun 25, 2007
10
0
Thanks for the replies!

Do any of you know if there is a version of GCC available for OSX? Because personally I don't like MinGW :p

Another quick question, are there any assemblers that work on OSX?
 

MacRohde

macrumors regular
Jun 1, 2004
164
0
Copenhagen, Denmark
Thanks for the replies!

Do any of you know if there is a version of GCC available for OSX? Because personally I don't like MinGW :p

Another quick question, are there any assemblers that work on OSX?

uhm, MingW is for Windows only, hence the name Minimalist GNU for Windows.

GCC is installed with Xcode.
 

plinden

macrumors 601
Apr 8, 2004
4,029
142
Thanks for the replies!

Do any of you know if there is a version of GCC available for OSX? Because personally I don't like MinGW :p

Yes:
yellow said:
Same compilers you're used to using, Gnu compilers.
chrisA said:
But under it all Xcode uses the GNU tool set same as Linuix.
MacRohde said:
Regarding C/C++ there's the GNU compiler set just as on Linux
 

Cromulent

macrumors 604
Oct 2, 2006
6,810
1,100
The Land of Hope and Glory
Thanks for the replies!

Do any of you know if there is a version of GCC available for OSX? Because personally I don't like MinGW :p

Another quick question, are there any assemblers that work on OSX?

As has already been stated Xcode uses GCC. I have not looked in depth but I assume it also comes with the GNU assemblers as well.

Edit : In fact it would have to. So yes, just install Xcode.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.