I am new to Linux, and C++. Usually when I used Java, I could just use javac Something.java and run it using java Something. How do I compile my own c++ code without the help of an IDE? Also I am using Linux Ubuntu 12.04
godzab
0
Junior Poster in Training
Recommended Answers
Jump to PostThe shell command you are looking for is
g++ filename -o executablename
, or at least that will get you started (the '-o' stands for 'output', and let's you choose the name of the final executable). Look up the documentation on
Jump to PostInstall the
build-essential
package usingsudo apt-get install build-essential
then useg++ filename -o outputname
as mentioned by Schol-R-LEA.This will produce the executable, you can then run it by typing
./outputname
.Enjoy coding in C++ on Linux!
All 5 Replies
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
GeissT
0
Newbie Poster
DriverDevel
0
Newbie Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
godzab
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.