致命错误C1060:编译器没有堆空间 [英] fatal error C1060: compiler is out of heap space

查看:864
本文介绍了致命错误C1060:编译器没有堆空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试编译一个C ++文件时,我一直收到错误。它包含一些带有模板的库标题,但我100%确定代码是正确的,因为它是一个受欢迎的,经过良好测试的库,我能够使用这些标题编译几个版本。

I keep getting that error when trying to compile one C++ file. It includes some library headers that are full with templates, but I'm 100% sure that code is correct since it's an popular, well tested library and I was able to compile with those headers a couple versions earlier.

首先,我尝试使用Visual C ++ 2008 SP1 EE,然后尝试使用VC ++ 2010 Beta 2.在VC ++ 2010中,行为更加糟糕,导致编译器以某种方式"缓存"。编译命令没有清理,没有代码更改,没有配置开关,没有手动删除Visual输出文件会强制重新编译尝试。

First I tried in Visual C++ 2008 SP1 EE, then VC++ 2010 Beta 2. The behaviour is even worse in VC++ 2010 cause the compiler somehow "caches" the compile command and no clean, no code changes, no configuration switches, no manual deleting of Visual output files can force a recompilation attempt.

我确实尝试了各种/ Zm值(从200到200 2000)但它没有效果。 cl.exe在分配350 MB之前退出,所以我怀疑内存不足是一个真正的问题(我有2G的Ram和2G的页面文件)。

I did try various /Zm values (from 200 to 2000) but it has no effect. cl.exe exits before it allocates 350 MB, so I doubt memory shortage is a real issue here (I have 2G of Ram and 2G of page file).

推荐答案

如果您想知道:g ++编译器对该代码没有任何问题。
In case you wonder: g++ compiler has no problems with that code.


这篇关于致命错误C1060:编译器没有堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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