c语言的报错信息,C语言编译器的错误信息

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

Not a valid expression format type 不合法的表达式格式

Not an allowed type 不允许使用的类型

Numeric constant too large 数值常太大

Out of memory 内存不够用

Parameter 'xxx' is never used 能数xxx没有用到

Pointer required on left side of -> 符号->的左边必须是指针

Possible use of 'xxx' before definition 在定义之前就使用了xxx(警告)

Possibly incorrect assignment 赋值可能不正确

Redeclaration of 'xxx' 重复定义了xxx

Redefinition of 'xxx' is not identical xx的两次定义不一致

Register allocation failure 寄存器定址失败

Repeat count needs an lvalue 重复计数需要逻辑值

Size of structure or array not known 结构体或数给大小不确定

Statement missing ; 语句后缺少";"

Structure or union syntax error X构体或联合体语法错误

Structure size too large 结构体尺寸太大

Sub scripting missing ] 下标缺少右方括号

Superfluous & with function or array 函数或数组中有多余的"&"

Suspicious pointer conversion 可疑的指针转换

Symbol limit exceeded 符号超限

Too few parameters in call 函数调用时的实参少于函数的参数不

Too many default cases Default太多(switch语句中一个)

Too many error or warning messages 错误或警告信息太多

Too many type in declaration 说明中类型太多

Too much auto memory in function 函数用到的局部存储太多

Too much global data defined in file 文件中全局数据太多

Two consecutive dots 两个连续的句点

Type mismatch in parameter xxx 数xxx类型不匹配

Type mismatch in redeclaration of 'xxx' xx重定义的类型不匹配

Unable to create output file 'xxx' 无法建立输出文件xxx

Unable to open include file 'xxx' 无法打开被包含的文件xxx

Unable to open input file 'xxx' 无法打开输入文件xxx

Undefined label 'xxx' 没有定义的标号xxx

Undefined structure 'xxx' 没有定义的结构xxx

Undefined symbol 'xxx' 没有定义的符号xxx

Unexpected end of file in comment started on line xxx

从xxx行开始的注解尚未结束文件不能结束

Unexpected end of file in conditional started on line xxx 从xxx

开始的条件语句尚未结束文件不能结束

Unknown assemble instruction 未知的汇编结构

Unknown option 未知的操作

Unknown preprocessor directive: 'xxx' 不认识的预处理命令xxx

Unreachable code 无路可达的代码

Unterminated string or character constant 字符串缺少引号

User break 用户强行中断了程序

Void functions may not return a value Void类型的函数不应有返回值

Wrong number of arguments 调用函数的参数数目错

'xxx' not an argument xxx不是参数

'xxx' not part of structure xxx不是结构体的一部分

xxx statement missing ( xx语句缺少左括号

xxx statement missing ) xxx语句缺少右括号

xxx statement missing ; xxx缺少分号

xxx' declared but never used 说明了xxx但没有使用

xxx' is assigned a value which is never used 给xxx赋了值但未用过

Zero length structure 结构体的长度为零

-出自百度贴吧 C语言吧

C语言中的错误`C2061`通常是由Microsoft Visual Studio编译器生成的,表示语法错误。该错误的具体信息一般为“syntax error : identifier”,即发现了一个无法识别的标识符。 ### 可能的原因及解决办法: #### 1. **未包含必要的头文件** 如果你在程序中使用了某些函数、变量或数据类型却没有引入相关的头文件,则会出现这种错误。例如,如果你试图使用 `printf()` 函数却忘记包含 `<stdio.h>`,就会引发 C2061 错误。 **解决方案**: 确保在源文件顶部包含了所有必需的标准库或其他外部依赖项。 ```c #include <stdio.h> // 对应于 printf 和 scanf 使用 int main() { printf("Hello World\n"); return 0; } ``` #### 2. **拼写错误** 检查是否存在键入失误的情况,比如将关键字打错了形式或者是声明变量名的时候有笔误等情形都可能导致这个情况发生。 **示例修复前后的对比** *修正之前* ```c nnt variablename = 5; // 'nnt' 应当改为'int' ``` *修正之后* ```c int variablename = 5; ``` #### 3. **结构体/联合体定义问题** 当我们自定义一些复杂的数据类型如 struct 或 union 的时候,如果顺序不当也可能造成这样的提示消息。比如说先引用再定义的话就有可能触发此类型的告警。 **例子说明如何避免此类状况** 正确的做法应该是先把需要使用的元素提前声明好后再去运用它们。 ```c struct Node{ int value; }; void process(struct Node *node){} // 正确地处理节点指针 /* 下面这种方式会出错 */ /* void process(Node *node); struct Node{...}; // 定义放在后面则导致前面未知名称的问题*/ ``` --- ### §相关问题§: 1. 哪些常见场景容易引起C2061? 2. 怎样通过调试工具定位并改正这类错误? 3. 是否其他品牌的IDE也会报告类似性质的信息?如果有又分别叫什么呢?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值