fatal error C1001: INTERNAL COMPILER ERROR 和 链接出错 unresolved external symbol _WinMain@16

关于 C1001 错误:编译器内部错误解析 有时候,这个错误可能是由于残留的缓存或损坏的临时文件引起的。“C1001” 是 Visual Studio 编译器的一种错误代码,表示编译器在处理源代码时遇到了一个内部的、无法处理的错误。有时候,错误可能是由于编译器本身的某个 bug 或不稳定性引起的。最后,如果以上方法都无效,我们可以尝试将问题代码精简到最小化,并报告给 Microsoft 的支持团队。然而,由于这是一个内部错误,我们无法直接确认导致错误的具体原因。在处理编译错误时,根据具体情况采取适当的解决方案是至关重要的。 阅读详情

1.fatal error C1001: INTERNAL COMPILER ERROR

最近在编译一个VC6.0工程(开发环境:win2000+VS6.0+Sp6),在加入预编译头后出现了下面的编译错误提示: c:/program files/microsoft visual studio/vc98/include/xlocnum(106) : 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.

 工程中的每个cpp文件编译都没有问题(除了预编译头对应的cpp文件),很是奇怪,于是在网上找了一下,找到下面一种解决办法:

VC6.0的一个编译错误的解决
在window98下使用vc6.0时,如果预编译头文件(stdafx.h)中包含了模板类的头文件,比如atl的头文件时,编译器会报错: fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786)

造成这种问题的原因是编译器分配的内存超过了限制。解决的办法有三种: 1.给编译器增大内存限制。在project(工程)->setting(设置)->c/c++的project option(工程选项)中,添加/Zm#nn选项,#nn是一个数字,取值最大为2000。默认为100。但是这种方法好像没有什么用处。 2.将模板类头文件从stdafx.h中移出; 3.不使用预编译头文件。project->setting->c/c++,选择所有的.cpp文件,都使用“不使用预编译头文件“的选项。缺点是编译的时候很慢。

http://www.ieasy.org/yuzuo/archives/2005_07.html

还有一个英文的:

I see that while compiling ITEL.CPP it is trying and failing to open Debug/IODIARY.PCH. I also see that there is no IODIARY.CPP. Exactly how is IODIARY.PCH supposed to be created? Turn off precompiled headers for all files in the project, and rebuild. If the build still fails, then... uh-oh.. Modify the project to use the default STDAFX.CPP/STDAFX.H method of using PCH. Then, add an empty file STDAFX.H and an empty file STDAFX.CPP to the project. Then, for each .CPP file, add as the first line #include "stdafx.h" . Then compile. This should work. If it does not... uh-oh. In order for pre-compiled headers to work properly each .CPP must have as its first #include statement the name of the one .H (such as STDAFX.H) that includes all the "actual" .H's (windows.h, stdio.h, etc.) that should be included by ALL .CPPs. That is the important part. You don't usually want EVERYsingle .H that is included in ANY .CPP in the project to be in STDAFX.H -- you do normally want windows.h, because it is the big one that can include a lot and is usually included in every .CPP. Putting just windows.h in stdafx.h (and removing it from all the .CPPs) can speed up the build tremendously. http://www.codecomments.com/archive307-2005-3-421145.html

在MSDN中搜索到这种错误相关主题:

*http://lab.msdn.microsoft.com/productfeedback/SearchResults.aspx?text=fatal+error+C1001%3a+INTERNAL+COMPILER+ERROR&stype=1&fields=1&type=0&witId=0&pId=0&category=0&os=0&oslang=0&status=0&msstatus=0&resolution=0&chgdays=&validation=0&votes=&voterating=0&workarounds=False&attachments=False

*http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/c1001.asp

后来把预编译去掉后,Build终于通过了运行了,可这也太慢了,郁闷中……

还不知有没更好的解决办法??同样的工程放在VC++.net2003中却编译顺利通过,运行正常.!!!!

 

2.unresolved external symbol _WinMain@16

下载源代码后链接出了问题,提示如上所示

在网上找到了解决方法

一,问题描述error LNK2001: unresolved external symbol _WinMainᤐdebug/main.exe:fatal error LNK 1120:1 unresolved externals error executing link.exe;

二,产生这个问题可能的原因

1, 你用vc建了一个控制台程序,它的入口函数应该是main, 而你使用了WinMain.

2.  你用vc打开了一个.c/.cpp 文件,然后直接编译这个文件,这个文件中使用了WinMian而不是main作为入口函数。vc这时的默认设置是针对控制台程序的。

三, 解决方法

1.进入project->setting->c/c++, 在category中选择preprocessor,在processor definitions中删除_WINDOWS, 添加_CONSOLE

2.进入project->setting->Link, 在Project options中将/subsystem:windows.改为/subsystem:console

3.保存设置,Rebuild All.

编译出错fatal error C1001: INTERNAL COMPILER ERROR 链接出错 unresolved external symbol _WinMain@16 1.fatal error C1001: INTERNAL COMPILER ERROR最近在编译一个VC6.0工程(开发环境:win2000+VS6.0+Sp6),在加入预编译头后出现了下面的编译错误提示:c:/program files/microsoft visual studio/vc98/include/xlocnum(106) : fatal error C1001: IN 阅读详情

相关推荐

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

有时会碰到奇怪的编译错误 fatal error C1001: INTERNAL COMPILER ERROR(compiler file 'msc1.cpp', line 1786) 致命错误C1001:内部编译器错误(编译器的文件'msc1.cpp “ ,线路1786 ) 解决方法是 用#include  替换  #include using names

yilingyeluo 6276

fatal error C1001: INTERNAL COMPILER ERROR

http://www.ieasy.org/yuzuo/archives/2005_07.html (余佐的blog) VC6.0的一个编译错误的解决 在window98下使用vc6.0时,如果预编译头文件(stdafx.h)中包含了模板类的头文件,比如atl的头文件时,编译器会报错:fatal error C1001: INTERNAL COMPILER ERROR(compiler file...

weixin_33730836的博客 262

对于VC++报错:fatal error C1001: INTERNAL COMPILER ERROR

<br />有以下两种可能:<br />1、运算符重载时遇到以上错误代码<br />解决方法:<br />将#include<iostream> 改成 #include<iostream.h><br />然后去掉 using namespace std;<br />编译即可通过!<br /> <br />或者你要前向声明类,然后声明友元函数(注意不要加friend),也可以顺利通过编译!<br />或者你打上vc6.0的sp6补丁就可以了!<br /> <br /> <br /> <br /> <br />

1万+

fatal error C1001: INTERNAL COMPILER ERROR错误解决

不知大家有没有碰到下面的问题,C++连接数据库时出现了 这么一个错误:fatal error C1001: INTERNAL COMPILER ERROR,我当时很是傻眼,不知道该如何去解决这样的一个错误,当然双击错误时跳入的是ado的com组件中。很是不理解。 通过百度知道,解决了这个问题,解决的方法如下:不要用using namespace std,用到其命名空间下的变量或者方法用std::

jiejieaiai的专栏 2136

fatal error C1001: 内部编译器错误】的一个原因

C++ 中写 Lambda 表达式的时候,要多注意一点。

Learning 1885

VC6.0的一个编译错误:fatal error C1001: INTERNAL COMPILER ERROR

最近在编译一个VC6.0工程(开发环境:win2000+VS6.0+Sp6),在加入预编译头后出现了下面的编译错误提示:c:/program files/microsoft visual studio/vc98/include/xlocnum(106) : fatal error C1001: INTERNAL COMPILER ERROR        (compiler file msc1.

roger007的专栏 2万+

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

Searching google with query string "compiler file 'msc1.cpp', line 1786" find the following  referencehttp://owlnext.sourceforge.net/qa51.html When template classes or template class header files are...

weixin_34326179的博客 274

VC++ 6.0 的编译错误: fatal error C1001: INTERNAL COMPILER ERROR

出现错误的图示如下:

上善若水的专栏 2528

fatal error C1001

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 err

【像男人一样去战斗】︻╋████◤ 1419

运算符重载 fatal error C1001: INTERNAL COMPILER ERROR(转)

运算符重载 fatal error C1001: INTERNAL COMPILER ERROR相关代码:class PrimeFieldElem{public:friend PrimeFieldElem operator+( const PrimeFieldElem ,const PrimeFieldElem );}解决方法:http://topic.csdn.net/t/20051219/0...

weixin_30507269的博客 192
上一篇: Linux Shell 命令详解
skilive
博客等级 码龄18年 4粉丝 2原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值