C++: Getting the c3859 error code while compiling in a mix of C++/CLI and C++

Will Marcouiller picture Will Marcouiller · Jan 4, 2011 · Viewed 14.5k times · Source

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.

Answer

Bradley Grainger picture Bradley Grainger · Jan 4, 2011
  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.