Under Linux, the (dynamic or static) libraries are usually stored in the /lib and /usr/lib directories, but there is an option for the linker to look for libraries in other directories. The executable file is smaller, but when the program is running the library must be installed on the machine. With dynamic edition, the executable file includes only a reference to the library. The generated program is therefore larger, but it contains all the code necessary for its execution. With static edition, the libraries are included into the executable file. It can integrate it into the executable file (static edition) or it can store a reference to the library (dynamic edition). The linker has two ways to use an external library. ![]() Finally, it generates the executable file. During this step, the linker checks that all the parts are compatible with one another and each referenced function or object is available. o files and the external libraries to form the executable file. The second step is linking, consisting in taking all the. Under Linux, headers are usually stored in the /usr/include and /usr/local/include directories, but there is an option for the compiler to add other directories to this list. cpp file, but it also needs to have access to all the. During this phase, the compiler needs the. o object files containing the binary code that the machine is able to run. The first step consists in compiling the source files, the. This installation is very simple thanks to cmake.įirst of all, let's have a short reminder of C++ and of the different steps of the life of a program written in C++. ![]() This week, we are going to show you how to compile our C++ programming library under Linux and to install it as a system library.
0 Comments
Leave a Reply. |