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

c++, c++-cli, marshalling, unmanaged

Solution

- Right-click your C++ project in Solution Explorer; choose Properties.

- In the Properties dialog, expand Configuration Properties > C/C++ > Command Line

- 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.

Problem

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.

Original source