11

After I have done as suggested by Hans Passant in C++: Getting the "error C2065: 'pst' : undeclared identifier" while using pstsdk? (which works), my code now looks like this:

private:
    System::Void readPstFileButton_Click(System::Object^  sender, System::EventArgs^  e) {
         pstsdk::pst myfile(marshal_as<std::wstring>(fileNameTextBox->Text));
    }

And I now get the following errors:

error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm111' or greater

error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit

I definitely didn't expect these to occur, and neither do I know how to solve them.

Community
  • 1
  • 1
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162

1 Answers1

40
  1. Right-click your C++ project in Solution Explorer; choose Properties.
  2. In the Properties dialog, expand Configuration Properties > C/C++ > Command Line
  3. In Additional Options, add /Zm120

Repeat this for Debug and Release and any other configurations you have.

For more information on what this command-line option does (and what changing it means), see the /Zm documentation.

Bradley Grainger
  • 27,458
  • 4
  • 91
  • 108
  • This compiles properly, plus I now understand what the `/Zm` option switch does, which helps me to learn more adequately. Thanks! =) (+1 and accepted answer) – Will Marcouiller Jan 05 '11 at 00:56
  • 1
    Just a tip: you can select all projects and add the same property sheet to them in one step. The sheet will also be added to debug and release builds. – Mene Oct 25 '14 at 20:31
  • 2
    this simply does not work for hundreds of people. We have already set to the max.. And it's completely random whether this error comes up on a rebuild all. – Dan Feb 22 '17 at 19:09