C语言常见错误中英文对照表
LNK LNK LNK
1169 2001 2005
warning
C4067
warning warning
C4091 C4101
one or more multiply defined symbols found unresolved external symbol _main _main already defined in Cpp1.obj unexpected tokens following preprocessor directive - expected a newline '' ignored on left of 'type' when no variable is declared 'xxx' unreferenced local variable '=' conversion from 'type1' to 'type2', possible loss of data 'initializing' truncation from 'const double' to 'float' ';' empty controlled statement found; is this the intent? 'xxx' function should return a value; 'void' return type assumed 'operator'operator has no effect; expected operator with side-effect '==' operator has no effect; did you intend '='? local variable 'xxx' used without having been initialized 'xxx' not all control paths return a value potential divide by 0
error error error error error error
C2051 C2052 C2057 C2058 C2059 C2064
case expression not constant 'type' illegal type for case expression expected constant expression constant expression is not integral syntax error 'xxx' term does not evaluate to a function 'xxx' undeclared identifier too many initializers redefinition of formal parameter 'xxx' function 'xxx' already has a body 'xxx' redefinition missing
c常见错误中英文对照表
错误类型 error 编号 C1003 错误内容 error count exceeds number; stopping compilation unexpected end of file found 中文对照 错误太多,停止编译
error
C1004
文件未结束
error
C1083
初始值过多 重复定义形式参数xxx 已定义函数xxx 标识符xxx重定义 下标未知 非法的间接访问运算符“*” 操作符需要左值 操作符的左操作数必须是左值
'<Unknown>' subscript
illegal indirection 'operator' needs l-value 'operator'left operand must be l-value cannot add two pointers 'xxx' array bounds overflow negative subscript or subscript is too large divide or mod by zero
expected preprocessor 期待预处理命令,但有无效字 directive, found 符 'character' expected exponent value, 期待指数值,不能是字符 not 'character' 'identifier1'is not a 标识符1不是标识符的成员 member of 'idenifier2' more than one default switch expression not integral default语句多于一个 switch表达式不是整型的
C4552 C4553
warning
C4700
warning warning
C4715 C4723
函数xx不是所有控制路径都有 返回值 有可能被0除
英文对照表
分析 修改之前的错误,再次编译 一个函数或者一个结构定义缺少“}”、或者在一个函数调用 或表达式中括号没有配对出现、或者注释符“/*„*/”不完整 等 头文件不存在、或者头文件拼写错误、或者文件为只读
出现一个或更多的多重定义符 号 未处理的外部标识main main函数已经在Cpp1.obj文件 中定义 预处理命令后出现意外的符号 - 期待新行 当没有声明变量时忽略类型说 明 变量xxx定义了但未使用
warning
C4244
赋值运算,从数据类型1转换为 数据类型2,可能丢失数据
warning
C4305
初始化,截取双精度常量为 float类型 ‘;’控制语句为空语句,是 程序的意图吗? 函数xxx应有返回值,假定返回 类型为void 运算符无效果;期待副作用的 操作符 “==”运算符无效;是否为“= ”? 变量xxx在使用前未初始化
warning
C4390
warning
C4508
warning warning
error error error error
C2110 C2117 C2118 C2Байду номын сангаас24
两个指针量不能相加 数组xxx边界溢出 下标为负或下标太大 被零除或对0求余
error error error error error error error error error error error error error error error error error error error LNK LNK
case表达式不是常量 case表达式类型非法 期待常量表达式 常量表达式不是整数 ‘xxx’语法错误 无法识别函数语言
error
C2065
未定义的标识符xxx
error error error error error error error error
C2078 C2082 C2084 C2086 C2087 C2100 C2105 C2106
'<Unknown>' function缺少函数标题(是否是老式的形 style initializer appears 式表?) to be a function definition switch expression of switch表达式为非法的xxx类型 type 'xxx' is illegal cannot allocate an array 不能分配长度为0的数组 of constant size 0 'xxx' local function 函数xxx定义非法 definitions are illegal 'type1' followed by 类型1后紧接着类型2,这是非 'type2' is illegal 法的 'xxx' function does not 函数xxx不能带n个参数 take n parameters 'xxx' must return a 函数xxx必须返回一个值 value cannot open file 无法打开文件Debug/Cpp1.exe "Debug/Cpp1.exe" cannot open 不能打开Debug/Cpp1.exe文件 Debug/Cpp1.exe for writing
C2133 C2137 C2143 C2146 C2144 C2181 C2196 C2296 C2297 C2371 C2440 C2447 C2448 C2450 C2466 C2601 C2632 C2660 C4716 1104 1168
'xxx'
unknown size
数组xxx长度未知
empty character constant 字符型常量为空 syntax error missing 在标识符或语言符号2前漏写语 'token1' before 'token2' 言符号1 syntax error missing 在标识符或语言符号2前漏写语 'token1' before identifier 言符号1 'identifier' syntax error missing ')' 在xxx类型前缺少‘) ’ before type 'xxx' illegal else without 非法的没有与if相匹配的else matching if case value '0' already case值0已使用 used '%' illegal, left operand has type 'float' '%' illegal, right operand has type 'float' 'xxx' redefinition; different basic types '=' cannot convert from 'char [2]' to 'char' missing function header (old-style formal list?) %运算的左(右)操作数类型为 float,这是非法的 %运算的左(右)操作数类型为 float,这是非法的 标识符xxx重定义;基类型不同 赋值运算,无法从字符数组转 换为字符 缺少函数标题(是否是老式的形 式表?)