C++ 如何在visual studio中设置编译标志/bigobj?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8225078/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 18:12:54  来源:igfitidea点击:

How to set compile flag /bigobj in visual studio?

c++visual-studiovisual-studio-2010visual-c++mfc

提问by ragnarius

I have a cpp file that contains a huge array.

我有一个包含巨大数组的 cpp 文件。

I get a fatal error (exceeded object file format limit) and the suggestion to compile with the flag /bigobj

我收到一个致命错误(超出目标文件格式限制)和使用标志 /bigobj 编译的建议

Where do I set this flag in visual studio?

我在哪里可以在 Visual Studio 中设置这个标志?

采纳答案by Hans Olsson

On the Command Line property page as described here.

在命令行属性页面描述在这里

回答by jww

According to MSDN and /bigobj (Increase Number of Sections in .Obj file):

根据 MSDN 和/bigobj(增加 .Obj 文件中的节数)

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
  2. Click the C/C++ folder.
  3. Click the Command Line property page.
  4. Type the compiler option in the Additional Options box.

在 Visual Studio 开发环境中设置此编译器选项

  1. 打开项目的属性页对话框。有关详细信息,请参见如何:打开项目属性页
  2. 单击 C/C++ 文件夹。
  3. 单击命令行属性页。
  4. 在“附加选项”框中键入编译器选项。