Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

compiling c++ in terminal

hey how can i compile and execute c++ programs in terminal?

kindly assist

mb 062 13/2, Mac OS X (10.4.10), color-white

Posted on Mar 17, 2008 2:02 AM

Reply
Question marked as Best reply

Posted on Mar 17, 2008 2:27 AM

When you have installed Xcode with the gcc compilers, use

g++ -o output file.cpp

Then run the programm with

./output

10 replies

Mar 21, 2008 1:29 PM in response to 10may.agn03

Unfortunately, no. That is only because I just don't know of any and haven't looked. I'm sure there are hundreds of such examples and tutorials. The thing you have to remember is that the only part of the process that is Mac-specific is launching Terminal.app. Once you have a command line, building on a Mac is the same as building on any UNIX or Linux system. 95% of the documentation you find for those systems will be applicable to MacOS X.

compiling c++ in terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.