Click to See Complete Forum and Search --> : Compiling a C / C++ program at the command line?


jwilson
03-07-2001, 08:38 PM
Hey guys, I'm new to linux and wanted to toy around with a little C or C++, which I haven't used in quite a while; however, I don't know how to compile it from the command line.

If I were to write a simple prog using vi (which by the way I like, call me sick if you want :D), what command do I use to compile?

binaryDigit
03-07-2001, 08:51 PM
gcc -o <new_executable_name> <somefile.c>

or just

gcc <somefile.c>

the second will name your binary a.out

for c++ subsitute gcc with g++

i recommend checking man gcc for more options and info.