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
’ 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 条评论)