当前位置:网站首页>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
边栏推荐
- EN 45545-2t10 precautions for smoke density detection by Horizontal method
- Sword finger offer 10- ii Frog jumping on steps
- En45545-2 R26 vertical combustion test introduction
- Introduction to knowledge atlas -- yedda annotation
- Iso8191 test is mentioned in as 3744.1. Are the two tests the same?
- leetcode - 739. Daily temperature
- php 上传大文件 超过40秒 服务器500
- SQL基本查询
- 经典图论,深度优先和广度优先,拓扑,Prim和Krukal,该来温习啦
- (二)从架构设计角度分析AAC源码-我的LiveData
猜你喜欢

Web design and website planning assignment 12 online registration form
![[cvpr2022] intensive reading of querydet papers](/img/10/a48e2c877946a1b9da71ce6e9546f7.png)
[cvpr2022] intensive reading of querydet papers

剑指 Offer 51. 数组中的逆序对

What if the copied code format is confused?
![[software tool] the hacker matrix special effect software CMatrix](/img/d3/bbaa3dfd244a37f0f8c6227db37257.jpg)
[software tool] the hacker matrix special effect software CMatrix

leetcode - 739. Daily temperature

Matlab学习7-图像处理之线性平滑滤波

MySQL upgrade

Android 面试笔录(精心整理篇)
![[Clickhouse column] user initialization of new library role](/img/00/a11fb1a8e38ed4e0634839160c8ead.png)
[Clickhouse column] user initialization of new library role
随机推荐
Oracle learning (I)
2022 Niuke winter vacation 3
Matlab学习9-图像处理之非线性锐化滤波
Cron expressions in scheduled tasks
GCC AVR (ATMEL studio+ AVR studio) how to define the structure array in the program memory (flash) space and read it
并查集是什么?你还在为其烦恼?其实就是一个连通图的问题,理解起来没有那么困难
Sword finger offer 40 Minimum number of K
SAP abap 字段符号
vagrant 安装踩坑
Wood board ISO 5660-1 heat release rate mapping test
2、 Rendering camera data
面试官问了四个问题,总结了4个经验
剑指 Offer 62. 圆圈中最后剩下的数字
预编译,编译,汇编,链接,静态库,动态库都是什么
命名实体识别之CRF的实现方式
光伏板怎么申请ASTM E108阻燃测试?
Interprocess communication
驱动壳美国测试UL 2043 符合要求有哪些?
What is the process of en 1101 flammability test for curtains?
M1 芯片指南:M1、M1 Pro、M1 Max 和 M1 Ultra