See Our Webmaster Tools for Windows and Mac

                                  

Why is linking necessary in a program?

Started by vashilove, November 23, 2019, 02:05:58 AM


sinelogixtech

Hi Friends,
I would recommend going and reading further research than just my answer but I can provide the basics of what is happening. When you compile your source code (using C++ as an example) the compiler takes you code and converts it into a set of instructions as an object file. This file can't actually run yet because it doesn't have all the features included in the language you are using. Once you run that object file through the linker it searches through and puts in all the commands needed from the libraries such as the Standard Library you included in your project. After this the linker is the what actually takes your object file and creates the single executable that you could run.