C and C++ are complied languages. Unlike Python which is typically interpreted, which means the run time converts the source code to computer understandable code as it runs, C/C++ has to go through a process to make it run on a computer. This process is called compiling, but there is actually several steps to this process.
Step one is to write your source code. Source code is written as a plain text (usually ASCII) file that will need to be compiled. If you use something like Visual Studio, Visual Source Code, Eclipse, etc – it may process some of these steps behind the scenes to help you debug faster.
A preprocessor will go through your source code looking for preprocessor directives – like your #include statements. This will generate an intermediary file.
The compiler takes the source code file(s) and converts them into an intermediate step – called object file. (Note: This is not a class object.) When you compile a file, you may notice one or more .obj files – this is the files that were created.
As part of the compiling process, your compiler may go through several optimization steps, depending upon your compiler and it’s settings, trying to optimize your code for efficiency of size and/or speed.
A linker will combine the system files, the object files, and linked files into an executable file, and/or other library style files (such as DLLs).
While the source code is platform independent, the executable is highly platform dependent, and based upon libraries that are used, you may or may not be able to recompile to a different system.
From C++ Source to Executable was originally found on Access 2 Learn