Quantcast Xcode help Text - Physics Forums Library

PDA

View Full Version : Xcode help


00PS
Aug26-08, 09:12 PM
So I took C and C++ classes in high school, and can remember most of it, but all of that was under Windows (devC++ to be exact). After switching to a mac in college I recently download Xcode and was a little intimidated with all the "developer tools". I don't really plan to use that stuff any time soon, but wanted a C++ compiler that runs native on macs. Anyways can I get some help on getting started and just compiling written programs. Like I said no help needed with the C++ just the enviroment. Thanks!

Coin
Aug26-08, 09:59 PM
If you've installed XCode, then XCode has already covertly installed GCC, which is the Mac OS X compiler. If you want to use GCC without bothering with XCode, just open a new window in Terminal and say

gcc filename.c -o programname

to compile filename.c, then say

./programname

to run it.

00PS
Aug26-08, 10:16 PM
what is the difference between filename.c and programname.c?

mgb_phys
Aug26-08, 10:31 PM
By default unix compilers generate an output executable called a.out (for historic reasons) rather than filename.exe on a dos machine.
You can tell gcc what to call the output executable with the "-o name" command.
When you get to more complicated programs you might have 100s of .c files so you have to tell the system what you want the output to be.

BryanP
Aug26-08, 10:45 PM
If you want to create a standard C++ class, create a new project that is a tool which is a C++ file. There's descriptions there. There's also the XCode manual that you can refer to which basically tells you which project to choose.

It's complex-looking at first, but XCode isn't that hard to use after awhile.

It's a great IDE, and this is coming from MinGW on the Windows platform.

00PS
Aug26-08, 11:03 PM
If you want to create a standard C++ class, create a new project that is a tool which is a C++ file. There's descriptions there. There's also the XCode manual that you can refer to which basically tells you which project to choose.

It's complex-looking at first, but XCode isn't that hard to use after awhile.

It's a great IDE, and this is coming from MinGW on the Windows platform.

I'm sorry, can you be more specific? I am using Xcode 3.1 if that is any consolation. :)

las3rjock
Aug26-08, 11:25 PM
I highly recommend Aaron Hillegass's book Cocoa Programming for Mac OS X to learn how to use XCode and how to develop Mac applications.