fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786)

本文解决了一个特定的内部编译错误C1001,该错误发生在使用预编译头文件并包含模板类或模板类头文件的情况下。错误只出现在装有Windows 95或Windows 98操作系统的机器上。提供了三种解决方案:增加编译器堆内存分配限制、从预编译头文件中移除模板类头文件或不使用预编译头文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Searching google with query string "compiler file 'msc1.cpp', line 1786" find the following
 reference

http://owlnext.sourceforge.net/qa51.html


When template classes or template class header files are included in a precompiled header file, the compiler may generate the following error for files that use the precompiled header:

   fatal error C1001: INTERNAL COMPILER ERROR
      (compiler file 'msc1.cpp', line 1786)

   -or-

   fatal error C1001: INTERNAL COMPILER ERROR
      (compiler file 'msc1.cpp', line 1188)
                              

This error occurs only on machines with the Windows 95 or Windows 98 operating system.

CAUSE

The compiler exceeds the allocated memory limit.

RESOLUTION

Use one of the following three suggested workarounds:

sumbul1a.gifUse compiler switch /Zm#nn to increase the compiler's heap memory allocation limit. The default value of #nn is 100 and the maximum value is 2000. Manually add this switch in Developer Studio: under the Project menu, click Setting, the click C/C++, then Project Options. Usually, a value of 1000 works.

NOTE: You may need to increase the system virtual memory to accommodate the increased #nn for /Zm. 工程| 设置 | “C/C++” | “工程选项"

-or-

sumbul1a.gifRemove the template class header files from the precompiled header file.

-or-

sumbul1a.gifUse "Automatic use of precompiled headers" (/YX switch), or, "Not using precompiled header."

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

  =================

Follow the first choice, add string [  /Zm"500" ] into Project Options.
 It works

转载于:https://www.cnblogs.com/cy163/archive/2006/02/10/328674.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值