C 语言常用错误代码释义大全,让你编译运行报错不是烦恼
前言:对于刚学编程,刚接触 C++的新手来说,编译运行报错是最头疼的一件事,爆出一堆英文,英语差一点的又不知道什么意思,所以也不知道如何去改,在此,我给大家传一份常见错误中英文对照表及简单解释,希望可以帮到大家。
1、fatal error C1003: error count exceeds number; stopping compilation
2、fatal error C1004: unexpected end of file found
3、fatal error C1083: Cannot open include file: ‘xxx’: No such file or directory
4、fatal error C1903: unable to recover from previous error(s); stopping compilation
5、error C2001: newline in constant
6、error C2006: #include expected a filename, found 'identifier’
7、error C2007: #define syntax
8、error C2008: ‘xxx’ : unexpected in macro definition
9、error C2009: reuse of macro formal 'identifier’
10、error C2010: ‘character’ : unexpected in macro formal parameter list
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201128143531115.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L20wXzUwNjYyNjgw,size_16,color_FFFFFF,t_70#pic_center
11、error C2014: preprocessor command must start as first nonwhite space
12、characters in constant
13、error C2017: illegal escape sequence
14、error C2018: unknown character '0xhh’
15、error C2019: expected preprocessor directive, found 'character’
16、error C2021: expected exponent value, not 'character’
17、error C2039: ‘identifier1’ : is not a member of 'identifier2’
18、error C2041: illegal digit ‘x’ for base 'n’
19、error C2048: more than one default
20、error C2050: switch expression not integral
21、error C2051: case expression not constant
22、error C2052: ‘type’ : illegal type for case expression
23、error C2057: expected constant expression
24、error C2058: constant expression is not integral
25、error C2059: syntax error : 'xxx’
26、error C2064: term does not evaluate to a function
27、error C2065: ‘xxx’ : undeclared identifier
28、error C2078: too many initializers
29、error C2082: redefinition of formal parameter 'xxx’
30、error C2084: function ‘xxx’ already has a body
31、error C2086: ‘xxx’ : redefinition
32、error C2087: ‘’ : missing subscript
33、error C2100: illegal indirection
34、error C2105: ‘operator’ needs l-value
35、error C2106: ‘operator’: left operand must be l-value
36、error C2110: cannot add two pointers
37、error C2117: ‘xxx’ : array bounds overflow
38、error C2118: negative subscript or subscript is too large
39、error C2124: divide or mod by zero
40、error C2133: ‘xxx’ : unknown size
41、error C2137: empty character constant。
42、error C2143: syntax error : missing ‘token1’ before ‘token2’error C2146: syntax error : missing ‘token1’ before identifier 'identifier’
43、error C2144: syntax error : missing ‘)’ before type 'xxx’
44、error C2181: illegal else without matching if
45、error C2196: case value ‘0’ already used
46、error C2296: ‘%’ : illegal, left operand has type ‘float’error C2297: ‘%’ : illegal, right operand has type 'float’
47、error C2371: ‘xxx’ : redefinition; different basic types
48、error C2440: ‘=’ : cannot convert from ‘char [2]’ to 'char’
49、error C2447: missing function header (old-style formal list?)error C2448: ‘’ : function-style initializer appears to be a function definition
50、error C2450: switch expression of type ‘xxx’ is illegal
51、error C2466: cannot allocate an array of constant size 0
52、error C2601: ‘xxx’ : local function definitions are illegal
53、error C2632: ‘type1’ followed by ‘type2’ is illegal
54、error C2660: ‘xxx’ : function does not take n parameters
55、error C2664: ‘xxx’ : cannot convert parameter n from ‘type1’ to 'type2’
56、error C2676: binary ‘<<’ : ‘class istream_withassign’ does not define this operator or a conversion to a type acceptable to the predefined operatorerror C2676: binary ‘>>’ : ‘class ostream_withassign’ does not define this operator or a conversion to a type acceptable to the predefined operator
57、error C4716: ‘xxx’ : must return a value
58、fatal error LNK1104: cannot open file "Debug/Cpp1.exe"
59、fatal error LNK1168: cannot open Debug/Cpp1.exe for writing
60、fatal error LNK1169: one or more multiply defined symbols found
61、error LNK2001: unresolved external symbol _main
62、error LNK2005: _main already defined in Cpp1.obj
63、warning C4003: not enough actual parameters for macro 'xxx’
64、warning C4067: unexpected tokens following preprocessor directive - expected a newline
65、warning C4091: ‘’ : ignored on left of ‘type’ when no variable is declared
66、warning C4101: ‘xxx’ : unreferenced local variable
67、warning C4244: ‘=’ : conversion from ‘type1’ to ‘type2’, possible loss of data
68、warning C4305: ‘initializing’ : truncation from ‘const double’ to ‘float’
69、warning C4390: ‘;’ : empty controlled statement found; is this the intent?
70、warning C4508: ‘xxx’ : function should return a value; ‘void’ return type assumed
71、warning C4552: ‘operator’ : operator has no effect; expected operator with side-effect
72、warning C4553: ‘==’ : operator has no effect; did you intend ‘=’?
73、warning C4700: local variable ‘xxx’ used without having been initialized
74、warning C4715: ‘xxx’ : not all control paths return a value
75、warning C4723: potential divide by 0
76、warning C4804: ‘<’ : unsafe use of type ‘bool’ in operation
版权声明: 本文为 InfoQ 作者【ShenDu_Linux】的原创文章。
原文链接:【http://xie.infoq.cn/article/413a7a9d92ffc36121e490438】。未经作者许可,禁止转载。
评论 (1 条评论)