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

问题描述

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

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.

这个错误很奇怪,因为它给出了解决方案:设置!

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?

我问这个问题,因为我不知道是否配置系统的不应设置 / 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:

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

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的惩罚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-16 21:22