
-----------------------------------
slAag
Mon Oct 29, 2007 3:23 pm

Editing/compiling on a Mac
-----------------------------------
Does anyone know what I should use and how I should compile on a Mac?  Everything I've seen so far is for windows.  Try and keep the downloads small too, cause im on dial-up...

-----------------------------------
rdrake
Mon Oct 29, 2007 3:38 pm

RE:Editing/compiling on a Mac
-----------------------------------
I thought Xcode supported C++, and that g++ was installed by default?  It should be on your install disc.  You can use any old editor for writing code if you wish, and something like the following to compile:

g++ .cpp -o 

-----------------------------------
slAag
Mon Oct 29, 2007 3:50 pm

Re: Editing/compiling on a Mac
-----------------------------------
Could you explain a little better?  Im not really familiar with this stuff yet, but i did find a file called "Xcode Tools".  Am i on the right track with that?

-----------------------------------
Clayton
Mon Oct 29, 2007 3:57 pm

RE:Editing/compiling on a Mac
-----------------------------------
Sounds right. And the above line that rdrake put in code tags is what you type in the terminal to compile your code, replacing  with the actual filename of course.

-----------------------------------
slAag
Mon Oct 29, 2007 4:15 pm

Re: Editing/compiling on a Mac
-----------------------------------
Well, ill go mess around with it for a bit then and try to figure out what im doing.

-----------------------------------
slAag
Mon Oct 29, 2007 5:39 pm

Re: Editing/compiling on a Mac
-----------------------------------
Well, the Xcode editor wont let me compile the file for some reason.  Could you tell me how to get into the command line?

-----------------------------------
Tony
Mon Oct 29, 2007 6:04 pm

RE:Editing/compiling on a Mac
-----------------------------------
Xcode does indeed come with the GCC suite, so g++ should be on your system. Though an enterprise level IDE such as Xcode is not needed (and indeed could be a bit overwhelming) for a beginner.

Your terminal is located in.. well: Appications -> Utilities -> Terminal

I would strongly encourage to keep it in your dock though.

-----------------------------------
slAag
Mon Oct 29, 2007 6:57 pm

Re: Editing/compiling on a Mac
-----------------------------------
Thanks, I keep everything in my dock  :)  Yeah, Xcode is a little overwhelming, but i think ive got the gist of it.

-----------------------------------
slAag
Mon Oct 29, 2007 7:21 pm

Re: Editing/compiling on a Mac
-----------------------------------
K, i have it mostly figured now, and its working.  Thanks for all your help guys.

-----------------------------------
wtd
Tue Oct 30, 2007 12:13 am

RE:Editing/compiling on a Mac
-----------------------------------
Oh, and makefiles are your friend!

-----------------------------------
slAag
Tue Oct 30, 2007 3:06 pm

Re: Editing/compiling on a Mac
-----------------------------------
makefiles?

-----------------------------------
wtd
Tue Oct 30, 2007 3:27 pm

RE:Editing/compiling on a Mac
-----------------------------------
http://en.wikipedia.org/wiki/Makefile

-----------------------------------
slAag
Tue Oct 30, 2007 3:45 pm

Re: Editing/compiling on a Mac
-----------------------------------
Is there a way to clean up the output screen a bit?  When i run the "hello world!" program, i get this in the output window.

Last login: Tue Oct 30 16:28:24 on ttyp2
/Users//Desktop/C++/helloworld; exit
Welcome to Darwin!
[:~] % /Users//Desktop/C++/helloworld; exit
Hello world!logout
[Process completed]

-----------------------------------
Tony
Tue Oct 30, 2007 4:03 pm

RE:Editing/compiling on a Mac
-----------------------------------
There is nothing extra in that output, everything appears as expected. Though if you don't call the exit (why are you doing that?), you don't have to see the welcome/exit statements more than once.

-----------------------------------
slAag
Tue Oct 30, 2007 4:18 pm

Re: Editing/compiling on a Mac
-----------------------------------
I dont think i did anything extra... But i only started C++ yesterday, so i wouldnt be surprised if i did.
