The most basic life cycle of the code is something like this:
- Write/modify a set of source code files;
- Compile all of them in certain order reflecting their dependency; you only need to compile only those not already compiled and not modified since previous compilation;
- Link the object files and libraries obtained on previous step and taken from 3rd parties (if any);
- Obtain the executable file(s) from the previous step, usually EXE and DLLs and run the EXE;
- When you perform (4), the system loader starts the new process each time you run the EXE (so there could be several processes started to execute the same application); the application is terminated by the user, by the OS or by the process itself (by user command or not) if it is programmed this way;
- If modification of the application is not required, go to (4);
- If modification is required, go to (1).
The dependencies can be resolved automatically bases on some
project file and file stamps; in this case the step (1) may include modification of a project file(s).
I only covered the basics of the life cycle typical for a C or C++ application. I also did not cover a multi-project solution, where you, basically, produce several executable files with some DLLs shared by several EXEs. The file naming *.exe or *.dll is just a Windows convention, the names can be different and are different in different systems.
There are different technologies and platforms where the life cycle is very different. For example, with the .NET platform, the life cycle is fundamentally different, intermediate files and libraries are different.
I did not cover the details on what compiler, linker and loader do and why they are separate; how the DLLs are loaded by the system loader or by the application code and how they can be used. The operations of each of these parts are not trivial at all. The parts of developer's code arranged in memory, names are resolved, all addresses are obtained and shifted according to positions of all parts in memory, and a lot more. Covering all this matter would take a really long article. You can read about it. This is the phase where you need at least a bit of systematic education, not just a set of cookbook result.
And yes, your assumptions you formulated in your question do not make sense; they are based on some misconceptions. You need to learn how things basically work before going to any esoteric fields.
—SA