INTERNAL COMPILER ERROR

weiasp 2005-07-12 02:05:42
我用VC++ \SP6
写了个很简单的程序,结果报了个错误:
--------------------Configuration: CLIPBOARD - Win32 Debug--------------------
Compiling...
A.C
c:\myproject\A\A.c(4) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1794)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.

A.OBJ - 1 error(s), 0 warning(s)

求解!!!
...全文
1334 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
oyljerry 2005-07-30
  • 打赏
  • 举报
回复
具体什么代码
weiasp 2005-07-30
  • 打赏
  • 举报
回复
还是解决不了啊。

有没有哪位高人,能帮我解决这个问题。
这个问题以前没有出现过,就最近出现的。是不是少了个什么文件什么的。
Kudeet 2005-07-12
  • 打赏
  • 举报
回复
Q122042 BUG: Fatal Error C1001 Using /Zg with Large C++ Header Files


在MS KB里有几篇讲这个问题的文章,你再多查查
Kudeet 2005-07-12
  • 打赏
  • 举报
回复
BUG: You may receive a "fatal error C1001: INTERNAL COMPILER ERROR" error message when template classes or template class header files are included in a precompiled header file
View products that this article applies to.

Article ID : 195738
Last Review : May 26, 2005
Revision : 3.0
This article was previously published under Q195738
On this page


SYMPTOMS
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.
Back to the top

CAUSE
The compiler exceeds the allocated memory limit.
Back to the top

RESOLUTION
Use one of the following three suggested workarounds: • Use 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.
• Remove the template class header files from the precompiled header file.
• Use "Automatic use of precompiled headers" (/YX switch), or, "Not using precompiled header."

Back to the top

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

This problem was corrected in Microsoft Visual C++ .NET.
Back to the top
handwolf 2005-07-12
  • 打赏
  • 举报
回复
按照一楼找的资料,试试
weiasp 2005-07-12
  • 打赏
  • 举报
回复
我安装了SP6,还是不能解决这个问题。
Kudeet 2005-07-12
  • 打赏
  • 举报
回复
Fatal Error C1001
INTERNAL COMPILER ERROR
(compiler file 'file', line number)

This error is most often generated in one of two cases:

Failure to recover the compiler's internal state following detection of a syntax error in the program. The first pass of the compiler will occasionally fail when attempting to recover its state following the detection of a malformed program. Typically, the compiler will have printed an error message (or messages) and will later produce an internal compiler error. In most cases, fixing the errors reported in your code and recompiling will solve the problem.


Failure of the code generator to find a way to generate correct code for a construct. This is most often caused by the interaction of an expression and an optimization option. The optimization has generated a tree which the compiler does not know how to handle. Such a problem can often be fixed by removing one or more optimization options when compiling the particular function containing the line indicated in the error message.
If no error messages have been emitted prior to the internal compiler error, then the next step is to determine which pass of the compiler is emitting the internal compiler error. This can be determined by recompiling the application with the /Bd option included. The /Bd option will cause each pass to print its name and arguments when it is invoked. The last pass invoked before the error is emitted is the one responsible.

If the pass indicated is P1, then the likely problem is still error recovery, as in number one above, but it is happening before the compiler has had a chance to emit the error message for the error it has just discovered. In such a case, examine the line on which the internal compiler error is reported. This line may also contain an unreported syntax error. Fixing any errors you find on that line will solve the internal compiler error in most cases. If you cannot find any error on that line or on the line previous to the one reported, contact Microsoft Product Support Services for help.

If the pass indicated is P2, then the problem can usually be fixed by removing one or more optimization options (or using a different code generator). You can determine which option is at fault by removing them one at a time and recompiling until the message goes away. Generally the last one removed is the problem and all other optimizations can be used safely. The most common culprits are /Og, /Oi, and /Oa. Once the offending optimization is discovered, it need not be turned off for the entire compilation. The offending optimization can be disabled with the optimize pragma while compiling the function where the error occurred, but enabled for the rest of the module.

More rarely, such errors occur at very low optimization levels or even when optimization is disabled. In such cases, rewriting the line where the error is reported (or possibly several lines including the one causing the error) may be a solution. If none of these options works, consult the technical support help file or the technical support section in one of your manuals.

msdn


有可能是VC有问题,记得好象是个BUG,装一个VC的SP6试试

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧