PDA

View Full Version : How to compile and execute .cpp file in Ubuntu?



x-ph
March 27th, 2007, 05:56 PM
Sorry for the stupid question, but I can't find the right commands...
Something like g++ file.cpp -o program01 and then?
Tnx in advance :)

silas_irl
March 27th, 2007, 06:10 PM
g++ -o file file.cpp

should do the trick, running ./file will run your program. Best to have -Wall present as well.

x-ph
March 27th, 2007, 06:28 PM
Thank you! It's all working :)