How to set compile flag /bigobj in visual studio?

2019-01-19 12:26发布

问题:

I have a cpp file that contains a huge array.

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

Where do I set this flag in visual studio?

回答1:

On the Command Line property page as described here.



回答2:

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

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.