VISUAL C ++ 9.0(2008)静态库+ Boost库=大的.lib文件 [英] Visual C++ 9.0 (2008) Static Lib + Boost Library = Large .lib File

查看:139
本文介绍了VISUAL C ++ 9.0(2008)静态库+ Boost库=大的.lib文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Visual Studio 2008的C ++项目,输出静态库,并使用Boost库的一些功能。当我建立调试配置的项目中,.LIB文件是7.84 MB。当我建立Release配置的项目中,.LIB文件是23.5 MB。 !!!!

I have a Visual Studio 2008 C++ project that outputs a static library and uses some functionality of the Boost Library. When I build the project in Debug configuration, the .lib file is 7.84 MB. When I build the project in Release configuration, the .lib file is 23.5 MB. !!!!

唯一Boost头我包括有:

The only Boost headers I include are:


  • 升压/ function.hpp

  • 升压/异常/ all.hpp

  • boost/function.hpp
  • boost/exception/all.hpp

由于这是一个静态库,我没有指定包括任何Boost库文件,但不知何故,这是一个极大的相输出。当我使用静态库在测试的可执行文件,生成的.exe文件只有746 KB的调试和231 KB的版本。

Since this is a static library, I don't have any Boost library files specified to include, but somehow it's a ginormous output. When I use that static library in a test executable, the resulting .exe file is only 746 KB in Debug and 231 KB in Release.

问题是,我要创建一个图书馆的释放检查到一个不同的版本库被其他项目使用。而且我会preFER不是要加我每次更新30 MB的文件。如果不出意外它真的让我困惑,为什么发布版本是调试规模的3倍。

The problem is that I have to create a "release" of the library to check into a different repository to be used by other projects. And I would prefer not to have to add 30 MB of files each time I update it. And if nothing else it really confuses me as to why the Release build is 3 times the size of the Debug.

任何人有任何建议,以我在做什么错了?

Anyone have suggestions as to what I'm doing wrong?

谢谢,
马特

推荐答案

项目+属性,C / C ++,优化,整个程序优化=号,至少应该从炸毁保持你的发布版本的大小。我不能瑞普调试库的大小,只是头给我一个111KB的.lib。

Project + Properties, C/C++, Optimization, Whole Program Optimization = No. That at least ought to keep your Release build size from blowing up. I can't repro the debug library size, just the headers gives me a 111KB .lib.

这篇关于VISUAL C ++ 9.0(2008)静态库+ Boost库=大的.lib文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆