Why is my static library so huge?

笑着哭i 提交于 2019-11-30 19:37:26

The static library is a considerably different format the finished binary; partially because it has quite a bit more information. Essentially, the static library acts like a ZIP of all the .obj files generated from your translation units. This allows the linker to throw out unused functions, and if you're using LTCG, it allows the inliner to make cross-module decisions and other such optimizations.

Additionally, some compilation modes will embed the debugging symbols directly in the .lib, removing the need for separate .pdb files.

Generally you shouldn't need to worry about static library size; the linker will throw out all the extra information when building the final executable.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!