The role of environment variables has been dynamic library static library

The role of environment variables has been dynamic library static library

First, you need to understand the concept of a computer system. What manages the computer hardware is the kernel of the operating system. This kernel needs to be protected. The general user communicates with the kernel through the shell to let the kernel achieve what we want to do. The operating system is actually a group of software that controls the entire hardware and the activity monitoring of the management system. If this group of software can be operated by the user at will, if the user applies improperly, the system will crash. But we always need to let the user operate the system, so there is an application on the operating system, and the user directs the kernel through the application. The function of the shell is to provide an interface to the user's operating system. So for the linux system, bash is used by default, so there is a bash environment. In the bash environment, there will be many default environment variables, such as HOME (user's home folder) SHELL (which program is the shell currently used in this environment) HISTSIZE MAIL PATH (search path for executable files) and so on.
From the perspective of software compilation, for an IDE, the environment variable is a path to the repository: the implementation of functions in the library, and for the program, some encapsulated library functions are called, dynamic libraries under windows .dll static library .lib; under linux.so.a, for the .exe lacking a library, it will look for its library function (1) the lack of dll will first look under the current file (2) under the environment variable, so this Is the role of environment variables

The difference between dynamic library and static library

Dynamic library: .dll .so directly adjust its interface, although the .exe is relatively small, but its dependence on dll is absolute, no library can not play, the market is generally dynamic library static library: .lib .a If you adjust The function will copy the entire function to the entire main.exe, the file is very large

Guess you like

Origin blog.csdn.net/z15005953031/article/details/115190593