How do I compile a .cpp file on Linux?

The Solution to How do I compile a .cpp file on Linux? is


You'll need to compile it using:

g++ inputfile.cpp -o outputbinary

The file you are referring has a missing #include <cstdlib> directive, if you also include that in your file, everything shall compile fine.

~ Answered on 2011-06-01 00:19:34


Most Viewed Questions: