<script type="text/javascript"><!-- google_ad_client = "pub-0241434510974184"; /* 博客文章广告728x90, */ google_ad_slot = "7316585398"; google_ad_width = 728; google_ad_height = 90; // --></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
1、fatalerrorC1010:unexpectedendoffilewhilelookingforprecompiledheaderdirective。
寻找预编译头文件路径时遇到了不该遇到的文件尾。(一般是没有#include"stdafx.h")
2、fatalerrorC1083:Cannotopenincludefile:'R…….h':Nosuchfileordirectory
不能打开包含文件“R…….h”:没有这样的文件或目录。
3、errorC2011:'C……':'class'typeredefinition
类“C……”重定义。
4、errorC2018:unknowncharacter'0xa3'
不认识的字符'0xa3'。(一般是汉字或中文标点符号)
5、errorC2057:expectedconstantexpression
希望是常量表达式。(一般出现在switch语句的case分支中)
6、errorC2065:'IDD_MYDIALOG':undeclaredidentifier
“IDD_MYDIALOG”:未声明过的标识符。
7、errorC2082:redefinitionofformalparameter'bReset'
函数参数“bReset”在函数体中重定义。
8、errorC2143:syntaxerror:missing':'before'{'
句法错误:“{”前缺少“;”。
9、errorC2146:syntaxerror:missing';'beforeidentifier'dc'
句法错误:在“dc”前丢了“;”。
10、errorC2196:casevalue'69'alreadyused
值69已经用过。(一般出现在switch语句的case分支中)
11、errorC2509:'OnTimer':memberfunctionnotdeclaredin'CHelloView'
成员函数“OnTimer”没有在“CHelloView”中声明。
12、errorC2511:'reset':overloadedmemberfunction'void(int)'notfoundin'B'
重载的函数“voidreset(int)”在类“B”中找不到。
13、errorC2555:'B::f1':overridingvirtualfunctiondiffersfrom'A::f1'onlybyreturntypeorcallingconvention
类B对类A中同名函数f1的重载仅根据返回值或调用约定上的区别。
14、errorC2660:'SetTimer':functiondoesnottake2parameters
“SetTimer”函数不传递2个参数。
15、warningC4035:'f……':noreturnvalue
“f……”的return语句没有返回值。
16、warningC4553:'==':operatorhasnoeffect;didyouintend'='?
没有效果的运算符“==”;是否改为“=”?
17、warningC4700:localvariable'bReset'usedwithouthavingbeeninitialized
局部变量“bReset”没有初始化就使用。
18、errorC4716:'CMyApp::InitInstance':mustreturnavalue
“CMyApp::InitInstance”函数必须返回一个值。
19、LINK:fatalerrorLNK1168:cannotopenDebug/P1.exeforwriting
连接错误:不能打开P1.exe文件,以改写内容。(一般是P1.Exe还在运行,未关闭)
20、errorLNK2001:unresolvedexternalsymbol"public:virtual__thiscallC……::~C……(void)"
连接时发现没有实现的外部符号(变量、函数等)。
functioncallmissingargumentlist调用函数的时候没有给参数。
memberfunctiondefinitionlookslikeactor,butnamedoesnotmatchenclosingclass成员函数声明了但没有使用
unexpectedendoffilewhilelookingforprecompiledheaderdirective在寻找预编译头文件时文件意外结束,编译不正常终止可能造成这种情况
本文汇总并解析了C++编程过程中常见的20种编译错误与警告信息,包括预编译头文件问题、文件找不到、类型重定义、语法错误、函数参数不符等,并给出了可能的原因及解决思路。
358

被折叠的 条评论
为什么被折叠?



