Compiling C++ Program Using GNU Compiler Collection (GCC)
The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages.
Below are the steps to compile C++ program using GCC:
e.g. Your c++ source file is in Desktop named hello.cpp
1. Open up terminal
(applications >>> accessories >>> terminal)
2. Go to path where your source file can be found
cd Desktop
3. Compile
g++ hello.cpp
4. Run the executable file created
./a.out
Note: a.out is the default executable file created when u you compile C++ source file using GCC. To overwrite this, when compiling supply with the filename you want in gcc command -o parameter. e.g. g++ -o hello.out hello.cpp

Post new comment