For those who are just starting out, this will explain how to compile a C++ executable, in a command prompt environment. First you must make sure you have installed Dev-C++ and set the System Variable for Path is set to express the location of MinGW. To Set the Environment variable: In windows to set the Path variable to include Dev-C++ commands, i. hightlight computer with the rh button, choose the option properties. ii. Choose task Advance system settings iii.Click Environment Variables (towards the end of panel) iv. Click twice in rapid succession the line that stars with the name Path. (line is placed in a panel ready to edit) v. Add the complete path to the bin folder of the Dev-C++ installation. v1. finish by clicking ok for all the panels opened.(3 panels). Test it: open a command window and enter: g++ (followed by return) It should reply with g++: no input files. If you got that, your environment variable was set up correctly otherwise try again. To compile: Now, assuming your directory for Dev-C++ is the default C:\Dev-cpp, and your Environment Variable is set to C:\Dev-cpp\bin, it is easy to start compiling a C++ executable. Open up an command prompt window and set the current directory to where your *.cpp file is. Example: For the file helloworld.cpp in the folder C:\docs\hello enter the command cd c:\docs\hello Now type the compile command g++ helloworld.cpp -o helloworld.exe The -o switch defines the name of the output file, without it the output file would be a.exe. To compile more than one file, list the files after the g++ command and before th -o command. Now you can compile the files one at a time, and then link them together to form an executable. Suppose we have the following files to form an executable: Rational.h, Rational.cpp, RatMain.cpp We can proceed to compile them first as follows: g++ -c Rational.h g++ -c Rational.cpp //makes Rational.o g++ -c RatMain.cpp // makes RatMain.o g++ Rational.o RatMain.o -o rats The last command creates an executable with name rats. To compile the header and implementation files first is a good idea before you use them in other files or main programs. Other Compiler Options The g++ compiler can help detect potential problems in a source file by producing additional error or warning messages. $ g++ -c -pedantic sort.cpp The g++ compiler implements language extensions not found in the ISO C++ standard. To make sure your code does not accidentally invoke these extensions, and thus rendering it non-portable, you can use the pedantic option to disable these extensions and produce error messages if they are accidentally used in the code. $ g++ -c -Wall sort.cpp The W option tells g++ to generates additional warning messages to warn you of potential problems (-Wall means all warnings). Of course, it can be combined with the pedantic option if you wish.