当前位置:网站首页>Does the go compiled executable have dynamic library links?
Does the go compiled executable have dynamic library links?
2022-06-26 09:46:00 【wohu1104】
Go Quotes from other packages , Is to compile all referenced packages . use ldd Look at a few Go Some compiled binary programs do not use dynamic link libraries . But some of them refer to dynamic link libraries , Why is this ?
answer :Go The default is on CGO_ENABLED Of , namely CGO_ENABLED=1 . But whether the compiled binary program has dynamic links , It depends on what package your program uses . If it is a hello world, Then the compiled program will be a pure static program .
If you rely on network packages or some system packages , For example, use http The package writes a web server, Then the compiled binary program will be a program containing dynamic links .
The reason lies in the current Go Standard library , Some functions have two implementations , One is C The realization of language , One is Go The realization of language .
- stay
CGO_ENABLEDWhen on ,GoThe linker will linkCLanguage version , So there is the situation of relying on dynamic link library . - If you will
CGO_ENABLEDSet as 0, You recompile the link , thatGoThe linker will useGoImplementation of version , In this way, you will get a pure static binary program without dynamic links .
边栏推荐
- [trajectory planning] testing of ruckig Library
- Wechat official account reported error 10003
- How to correctly open the USB debugging and complete log functions of Huawei mobile phones?
- How to solve the problem that NVIDIA model cannot be viewed by inputting NVIDIA SMI and quickly view NVIDIA model information of computer graphics card
- Force buckle ----- remove the maximum and minimum values from the array
- Champions League data set (Messi doesn't cry - leaving Barcelona may reach another peak)
- 爬虫相关文章收藏:pyppeteer 、Burpsuite
- 3 big questions! Redis cache exceptions and handling scheme summary
- 【CVPR 2021】DatasetGAN: Efficient Labeled Data Factory with Minimal Human Effort
- jz2440---使用uboot燒錄程序
猜你喜欢

Force buckle ----- remove the maximum and minimum values from the array

Logview Pro can be used if the log is too large

logback

【CVPR 2021】DatasetGAN: Efficient Labeled Data Factory with Minimal Human Effort

PHP extracts TXT text to store the domain name in JSON data

【轨迹规划】Ruckig库的测试

Detailed explanation of the network security competition questions (2) of the 2021 national vocational college skills competition (secondary vocational group)

Thinkphp5 manual error reporting

Jz2440--- using uboot burning program

测试须知——常见接口协议解析
随机推荐
LeetCode 498. 对角线遍历
LeetCode 基本计算器 224. 227. follow up 394
Regular expression learning
The 100000 line transaction lock has opened your eyes.
Explained: A Style-Based Generator Architecture for GANs (StyleGAN)
Common SQL add / delete / modify query statements
c语言语法基础之——局部变量及存储类别、全局变量及存储类别、宏定义 学习
2021-11-12 vrep视觉传感器配置
Throttling, anti chattering, new function, coriolism
PHP extracts TXT text to store the domain name in JSON data
Opencv depthframe - > pointcloud causes segmentation fault!
Cancellation and unbinding of qiniu cloud account
logback
QPM performance monitoring components - General
OpenCV depthframe -> pointcloud 导致 segmentation fault!
GAN Inversion: A Survey
Joint Noise-Tolerant Learning and Meta Camera Shift Adaptation for Unsupervised Person Re-ID
安装 新版本cmake & swig & tinyspline
欧冠比赛数据集(梅西不哭-离开巴萨也可能再创巅峰)
LeetCode 0710.黑名单中的随机数 - 预处理实现O(1)取值