PDA

View Full Version : Programming in OSX.




linuxftw
Jun 25, 2007, 01:22 PM
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.



yellow
Jun 25, 2007, 01:26 PM
http://developer.apple.com

Same compilers you're used to using, Gnu compilers.

Libraries and Tools are free from Apple.

Go to the above site, sign up (free), and downloaded the latest version of XCode.

Consider getting a book on Objective-C and Cocoa programming.

http://www.cocoadev.com/

ChrisA
Jun 25, 2007, 02:49 PM
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
Jun 25, 2007, 03:13 PM
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
Jun 25, 2007, 04:25 PM
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
Jun 25, 2007, 04:29 PM
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
Jun 25, 2007, 04:34 PM
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:
Same compilers you're used to using, Gnu compilers.
But under it all Xcode uses the GNU tool set same as Linuix.
Regarding C/C++ there's the GNU compiler set just as on Linux

Cromulent
Jun 25, 2007, 04:46 PM
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.

MagicUK
Jun 25, 2007, 04:46 PM
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 ...

Thanks, very useful post.