PDA

View Full Version : New Macbook Pro, trying to compile through terminal




Shinny
Mar 3, 2008, 05:00 PM
When I first got old macbook, I was able to compile through terminal by just typing g++ and the target. I was in a lab class and I don't remember if someone help me install some stuff so I was able to compile. That the macbook I was using stop working so I now have a Macbook Pro. It arrived this morning so I just took it out of the box and put it in my backpack and rush out the door.

So I was working on my project for class. I took the files from the school Unix server and put them in my directory. There was a makefile included with it, and I type "make" but it gives me this -bash: make: command not found.
Then I tried just to g++ my files and it gives me command not found. I'm guessing I don't actually have a compiler. Is that the right conclusion? If that right, do I go download xcode and will I be able to compile through terminal?



TEG
Mar 3, 2008, 05:02 PM
Use gcc. If all those aren't there, then you need to install the XCode Tools, because, I don't they they are installed my default.

TEG

Shinny
Mar 3, 2008, 05:09 PM
I think I don't have gcc that's probably why I can't compile my programs when type g++. If I download Xcode will it install everything so I'd be able to the compiler though terminal ?

toddburch
Mar 3, 2008, 05:32 PM
Yup.

TEG
Mar 3, 2008, 06:18 PM
Yes.

TEG

Shinny
Mar 3, 2008, 07:07 PM
Thanks for the help, I knew there was something missing when I tried to run makefile.

Shinny
Mar 4, 2008, 12:00 AM
I didn't want to make a new thread but it's about Xcode. In the old Xcode, I don't remember what version, I could just command r and it would pop out my program so I could test it. In this new version, it doesn't do that. Is there a way that I can get it to pop up because it's kind of a minor hassle everytime I want to test out my program.

TEG
Mar 4, 2008, 02:31 AM
I don't know, as I just used terminal for the compiling and testing, and just used Xcode for the Syntax highlighting.

TEG

Sijmen
Mar 4, 2008, 03:12 AM
Open the console: ⇧⌘R (Run->Console)