linux - c/c++的标准库在连接的时候是静态连接还是动态连接?
ringa_lee
ringa_lee 2017-04-17 13:56:25
0
5
664
ringa_lee
ringa_lee

ringa_lee

reply all(5)
Peter_Zhu

First of all, no matter what dependent libraries are called by the internal implementation of the template, the code generated by the template itself is statically linked. Because the target code of the template is generated instantly by the compiler at that time, the first two files are statically linked. Yes, the dependent things may exist in libstdc++ (libc++ or others), this part is dynamically linked
Most of the things in the third file are standard IO and other things in C, these things exist in libc ,
is a dynamic link. .

小葫芦

Both iostream and string are templates, so there is actually no difference between static and dynamic. If you use symbols such as cout, fopen, etc., then you will need to provide static files, or ask the other party to install Visual C++ 2015 Redistribution

伊谢尔伦

The first two are static links, and the third one is dynamic link.

左手右手慢动作

Prioritize dynamic linking. Under Linux, you can use ldd to check which dynamic libraries you depend on. If there is a dynamic library, it means that the static library is not linked in.

大家讲道理

Can be static or dynamic. You can check your project's compilation and linking settings. For example, you can select "Multi-threaded static library" or "Multi-threaded DLL" in VC++.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!