compiling c++ on mac

Joined
Jul 27, 2010
Messages
2
Reaction score
0
Points
1
Hello everyone,

I have used C++ on linux and windows before through command (terminal).
Now I want to do the same but on a mac.
I have two problems:

1. Wich commands do I need to use?

On linux i used the g++ compiler. Can you do the same on a mac?

2. How can I save a .cpp file ---> my text editor want to convert it to ".rtf".
 
Joined
Feb 25, 2009
Messages
2,112
Reaction score
71
Points
48
Your Mac's Specs
Late 2013 rMBP, i7, 750m gpu, OSX versions 10.9.3, 10.10
Hi! welcome to the forums.

1) gcc or g++ will do - you may need to install xcode which is included on the OS distribution DVD. If you can't locate your DVD you can always download the latest version from Apple. XCode contains all of the development tools for OSX. If you want to use gcc/g++ thru the command line, just launch Terminal - it's under: Applications->Utilities

2) You have multiple options:
a) Use xcode to create and build your projects (xcode is a full ide for OSX GUI, iOS, and command line tools)
b) Use Text editor (yuck) to create your source files, make sure in Format dropdown you set to Make Plain Text - that will stop the annoying rtf.
c) Use a tool like JEdit that has syntax highlighting and auto indentation for various languages to make reading code easier
d) Use vi in the command prompt to edit your source files.
 
OP
E
Joined
Jul 27, 2010
Messages
2
Reaction score
0
Points
1
Thanks for the help

Thanks for the quick reply,
It was verry helpfull.

greets,

Err0rman
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top