Software Design Using C++Using the g++ Compiler under LinuxIf you have the g++ compiler installed under Linux, you use something like the following at the command prompt to compiler a single-file program:
Note that the above places the output into an executable file named sample. (The name following the -o option is the name that is used for the executable.) The source code is in the sample.cpp file. If you have a multiple-file project, use something like this:
This again places the output into an executable file named sample. The source code files were sample.cpp, aux1.cpp, and aux2.cpp. To get a smaller executable you can add the -s option. This strips the symbol table off of the executable. Here is an example of the use of the -s option:
Back to the main page for Software Design Using C++ |