当前位置:网站首页>What are precompiled, compiled, assembled, linked, static and dynamic libraries
What are precompiled, compiled, assembled, linked, static and dynamic libraries
2022-06-11 08:52:00 【Currybeefer】
precompile :
Precompiling is also called preprocessing , Is to do some code text replacement work
Expand the header file , uncomment , Replace all macro defined symbols
compile :
Lexical analysis of the file , Syntax analysis , Semantic analysis , After symbol summary , Translate the code into assembly language ( Assembly language is MOV,ADD Things like that )
assembly :
Convert the file to binary file, i.e. target file , Each source file corresponds to a target file , stay windows The suffix of the target file in is .obj
link :
It's really just a “ pack ” The process of , It combines all binary object files and system components into an executable file . The process of completing the link also requires a special software , It's called a linker .
After the assembly , Each object file has not yet “ contact ” get up , A function or variable used in an object file , It may be defined in other object files , It may also be defined in a link library file . For the storage address of the missing functions and variables in each object file , In the linking phase, the linker , And finally organize all the target files and link libraries into an executable file . stay windows The next executable file is suffixed with .exe.
Link library :
The so-called link library , Is to compile some source files , Binary file after packaging . Although link libraries are binary files , But it cannot run independently , Must wait for other program calls , Will be loaded into memory . Library files often have a header file , It is convenient for programs that need to link this library to see how to call . Link libraries are divided into static libraries and dynamic libraries .
Static library :
Windows Middle suffix is .lib. Static libraries will be directly integrated into the target program during compilation , The packaged files can run independently anywhere . The file compiled from the static function library will be relatively large , If this static library is updated by , You need to recompile .
Dynamic library :
windows Middle suffix is .dll. Dynamic libraries are not integrated into the target program at compile time , The generated executable cannot be run alone . Therefore, there are still missing variables and functions in the compiled linked file , These defects will be fixed when the program is running . In particular , For a project that runs as a dynamic link , First, the static linker organizes all the target files into an executable file , The runtime will load all the required dynamic link libraries into memory , The dynamic linker completes the linking of executable files and dynamic library files .
Dynamic link libraries can be loaded into memory along with executable files , You can also load... While the executable is running , When the executable file is needed , Dynamic link library will be loaded into memory .
For different libraries , What the linker does in the linking phase is different .
For static libraries , The linker will find the missing addresses in each target file one by one . The executable file generated by this link , It can be loaded into memory and run independently .
For dynamic libraries , The linker first finds some missing addresses from all the target files , Then organize all the target files into one executable file . The executable file thus generated , The addresses of some functions and variables are still missing , To be executed , It needs to be loaded into memory together with all link library files , Then the linker completes the remaining address repair work , Can be executed normally .
Reference link :
https://blog.csdn.net/yao00037/article/details/120166233
http://c.biancheng.net/dll/what_is_library.html
边栏推荐
- [cvpr2022] intensive reading of querydet papers
- What if the copied code format is confused?
- 完整的ES6面试题
- leetcode - 518. 零钱兑换 II
- 【Image Processing】空间域图像增强
- Zipkin入门
- PVC plastic sheets BS 476-6 determination of flame propagation properties
- 木板ISO 5660-1 热量释放速率摸底测试
- BS 7176 fire resistance test for upholstered furniture
- How to apply for BS 476-7 sample for display? Is it the same as the display
猜你喜欢
随机推荐
GCC AVR (ATMEL studio+ AVR studio) how to define the structure array in the program memory (flash) space and read it
K8s application (IV) - build a redis5 cluster (for direct external access)
vagrant 安装踩坑
命名实体识别之CRF的实现方式
(1) AAC opening - lifecycle, livedata, ViewModel and source code analysis skills of core component principles (Reprint)
深度学习入门之pytorch安装
室内膨胀型防火涂料根据BS 476-21 耐火标准测定需要符合几项?
面试官问了四个问题,总结了4个经验
智能控制理论小题库
Hibernate L2 cache
剑指 Offer 40. 最小的k个数
剑指 Offer 10- II. 青蛙跳台阶问题
c的printf相关
Mazhiqiang: research progress and application of speech recognition technology -- RTC dev Meetup
Is the result too different from the goal? With the help of target management, you can reach the target accurately!
指定环境下安装Jupyter
Matlab r2022a installation tutorial
ActiveMQ简单教程,适合初学者,学习笔记yyds
Are the test methods of CMVSS TSD No. 302 and 49 CFR 571.302 the same
(2) Analysis of AAC source code from the perspective of architecture design - my livedata








