PDA

View Full Version : c++ comandline compilers



firefly123
March 1st, 2006, 09:19 PM
Hi im starting to learn c++ i want to use gEdit, but what comand line compiler shoud i use????? ps im a nubie:)

jerome bettis
March 1st, 2006, 09:44 PM
first you need to install the build-essential package, sudo apt-get install build-essential

g++ hello.cpp to compile it
./a.out will run it

or

g++ -o hello hello.cpp
./hello

Vanderley Maia
March 7th, 2006, 01:14 AM
Thank's
But I compiled a my program, but I cant execute it :cry:
How can I do that?

hod139
March 7th, 2006, 01:33 AM
Depends on how you compiled it. As jerome bettis wrote, (with some minor modifications by me)



g++ hello.cpp <-- to compile it
./a.out <-- will run it

or

g++ -o hello hello.cpp <-- to compile it
./hello <-- will run it


In the first example, the default executable name of a.out was used. In the second example, jerome bettis specified a name to use (using the -o flag) and changed the execution command to reflect the new name.