MSVS编译器标志/ bigobj的惩罚 [英] Penalty of the MSVS compiler flag /bigobj

查看:312
本文介绍了MSVS编译器标志/ bigobj的惩罚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本的Google搜寻 bigobj问题显示,很多使用者都会遇到 Fatal错误C1128 超过目标文件格式的段数限制:compile with / bigobj 。如果大量使用C ++模板库,例如 Boost库 CGAL库

The basic Google search bigobj issue shows that a lot of people are experiencing the Fatal Error C1128: "number of sections exceeded object file format limit : compile with /bigobj". The error has more chance to occur if one heavily uses a library of C++ templates, like Boost libraries or CGAL libraries.

这个错误很奇怪,因为它给出了解决方案:设置编译器旗帜 / bigobj

That error is strange, because it gives the solution to itself: set the compiler flag /bigobj!

这里是我的问题:为什么不是默认设置的标志?必须有使用该标志的惩罚,否则将默认设置。这种惩罚在MSDN中没有记录。有人有线索吗?

So here is my question: why is not that flag set by default? There must be a penalty of using that flag, otherwise it would be set by default. That penalty is not documented in MSDN. Does anybody have a clue?

我问这个问题,因为我不知道是否配置系统的 CGAL 不应设置 / bigobj

I ask the question because I wonder if the configuration system of CGAL should not set /bigobj by default.

推荐答案

文档确实提到了 / bigobj 的一个重要缺点:

The documentation does mention an important drawback to /bigobj:


到Visual C ++ 2005无法读取使用 / bigobj 生成的.obj文件

Linkers that shipped prior to Visual C++ 2005 cannot read .obj files that were produced with /bigobj.

因此,默认情况下设置此选项将限制可以使用生成的目标文件的链接器的数量。更好地在需要的基础上激活它。

So, setting this option by default would restrict the number of linkers that can consume the resulting object files. Better to activate it on a need-to basis.

这篇关于MSVS编译器标志/ bigobj的惩罚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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