The very common way we know to compile a C++ program is by running the following command:

g++ filename.cpp -o filename

Talking in terms of stages of optimized compilation, this method is the basic one — we can say stage 0, also written as:

g++ -O0 filename.cpp -o filename

There are a few more, from zero to three. Let's talk about these ways of compilation.