C++ compiler (terminal)

Joined
Apr 13, 2008
Messages
1
Reaction score
0
Points
1
hey im new to mac, just got it yesterday. but ive been learning c++ on windows and i used visual c++. so for my mac i downloaded xcode but it seemed really complex for my menial programs and i didnt like how you couldnt compile a file-only projects.

so i downloaded textwrangler and i wrote a c++ program (copied from book) and i dont know how to compile it in terminal.

on windows i use the code: cl/EHsc filename.cpp but obviously this is not windows

so if anyone can tell me the coding to compile and execute a c++ program, please do so. thank you very much in advance
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
in terminal I normally issue something like

g++ -v -Wall program.cpp -o OutPutFileName


a quick man g++ will give you all the options
 
Joined
Mar 3, 2008
Messages
7
Reaction score
0
Points
1
Your Mac's Specs
MacBook 2.2GHz 4GB RAM Black
Hi, you can create a new project through command line utility->C++ Tool, then if you want monitor the output you can open Console in menu->run->Console. This solution is just for C++ programs using standard library only.
 

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