Release mode static library much larger than debug mode version

試著忘記壹切 提交于 2019-11-29 03:06:52
sharptooth

The difference is specifically because of link-time code generation. Read the chapter Link-Time Code Generation in Compilers - What Every Programmer Should Know About Compiler Optimizations on MSDN - it basically says that with LTCG turned on the compiler produces much more data that is packed into the static library so that the linker can use that extra data for generating better machine code while actually linking the executable file.

Since you have LTCG off in Debug configuration the produced library is noticeably smaller since it doesn't have that extra data.

PS: Original Link (not working at 11/09/2015)

The optimization could be the issue here, notably automatically created inline functions will be bigger but faster in release than debug.

Personally I've never seen a release PDB be larger than a debug PDB. Same deal for LIBs.

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