Visual C++常见错误信息
VC编译出错时会指示出程序错误的位置,鼠标双击出错信息行,就可以实现错误的定位。
1fatal error C1083: Cannot open include file: 'R…….h': No such file or directory
不能打开包含文件“R…….h”:没有这样的文件或目录。
2error C2018: unknown character '0xa3'
不认识的字符'0xa3'。(一般是汉字或中文标点符号)
3. fatal error C1004: unexpected end of file found
源文件的‘{’ ‘}’不匹配。
4error C2057: expected constant expression
希望是常量表达式。(一般出现在switch语句的case分支中)
5error C2065: 'abc' : undeclared identifier
“abc”:标识符没定义,有两种可能,一是未定义;二是在引用时标识符的名字写错了。
6LINK : fatal error LNK1168: cannot open for writing
连接错误:不能打开P1.exe文件,以改写内容。(一般是P1.Exe还在运行,未关闭)
7warning C4700: local variable 'bReset' used without having been initialized
局部变量“bReset”没有初始化就使用。
8 C2001: newline in constant
  This error is usually caused by a string or character constant that is missing its closing ' or " symbol
9error C2084: function 'void __cdecl main(void)' already has a body
在一个源文件中定义了两个main函数。初学者易犯的错误。一个程序完成后,没有关闭相应的源文件,接着,在下面又编辑了另一个程序,把两个不相关的程序放在一个源文件中。
10error C2143: syntax error: missing ':' before '{'
句法错误:“{”settimer头文件前缺少
11error C2146: syntax error : missing ';' before identifier 'dc'
句法错误:在“dc”前丢了
12error C2196: case value '69' already used
69已经用过。(一般出现在switch语句的case分支中)
13error C2660: 'SetTimer' : function does not take 2 parameters
“SetTimer”函数不传递2个参数。
14warning C4035: 'f……': no return value
函数“f……”return语句没有返回值。
15、引起LNK2001unresolved external symbol “srot”
链接程序不能在所有的库和目标文件内到所引用的函数、变量或标签。有两种情况:一是调用了库函数,但没有把它的头文件包含近来;二是调用了用户自己定义的函数sort,但函数名写成了srot
16error C2082: redefinition of formal parameter 'bReset'
函数参数“bReset”在函数体中重定义。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。