22

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?

ragnarius
  • 5,642
  • 10
  • 47
  • 68

2 Answers2

19

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.
jww
  • 97,681
  • 90
  • 411
  • 885
  • 8
    It's disgusting that you have to use the command line to add a flag mentioned by the VC compiler - thanks for adding the link to MSDN to verify. – Mike Sadler Aug 10 '18 at 09:46
  • @MikeSadler It is quite amazing how you interpreted "Command Line property page" wrongly. – jacmoe Feb 02 '21 at 02:07
  • Note that this is slightly overkill. On the **project** page, you set this option for every .cpp file in the project. The question wonders about a single .cpp file. In Visual Studio, this Command Line property page is also available at individual file level. – MSalters Aug 22 '23 at 07:57
13

On the Command Line property page as described here.

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116