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 PostFor simple C++ executables, you can just use the make command directly. So, if you want to build a simple C++ source file named my_application.cpp, you can just execute the command: make my_application
That will compile and link the executable for you quite nicely. A Makefile is unnecessary unless you …
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.