View Full Version : c++ comandline compilers
firefly123
March 1st, 2006, 04: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, 04: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 6th, 2006, 08:14 PM
Thank's
But I compiled a my program, but I cant execute it :cry:
How can I do that?
hod139
March 6th, 2006, 08:33 PM
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.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.