C ++:在C ++ / CLI和C ++混合编译时获取c3859错误代码 [英] C++: Getting the c3859 error code while compiling in a mix of C++/CLI and C++

查看:821
本文介绍了C ++:在C ++ / CLI和C ++混合编译时获取c3859错误代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我按照Hans Passant在 C ++:获取错误C2065:'pst':undeclared identifier而使用pstsdk?(它的工作原理),我的代码现在看起来像这样:

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

现在我遇到以下错误:


错误C3859:超过了PCH的虚拟内存范围;请重新编译命令行选项'-Zm111'或更大



错误C1076:编译器限制:达到内部堆限制;使用/ Zm指定更高的限制


我绝对没有想到这些发生,我也不知道如何解决

解决方案


  1. 在解决方案资源管理器中右键单击您的C ++项目;选择属性。

  2. 在属性对话框中,展开配置属性> C / C ++>命令行

  3. 在其他选项中,添加 / Zm120

对于Debug和Release以及您拥有的任何其他配置重复此操作。

有关此命令行选项的作用(及其变化意味着)的更多信息,请参阅 / ZM文档


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.

解决方案

  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.

这篇关于C ++:在C ++ / CLI和C ++混合编译时获取c3859错误代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆