MDK常见错误详解集合

更新时间:2023-05-08 19:15:16 阅读: 评论:0

MDK常见错误详解集合错误代码及错误信息错误释义
error 1: Out of memory 内存溢出
error 2: Identifier expected 缺标识符
error 3: Unknown identifier 未定义的标识符
error 4: Duplicate identifier 重复定义的标识符
error 5: Syntax error 语法错误
error 6: Error in real constant 实型常量错误
error 7: Error in integer constant 整型常量错误
error 8: String constant exceeds line 字符串常量超过⼀⾏
error 10: Unexpected end of file ⽂件⾮正常结束
error 11: Line too long ⾏太长
error 12: Type identifier expected 未定义的类型标识符
error 13: Too many open files 打开⽂件太多
error 14: Invalid file name ⽆效的⽂件名
error 15: File not found ⽂件未找到
error 16: Disk full 磁盘满
error 17: Invalid compiler directive ⽆效的编译命令
error 18: Too many files ⽂件太多
error 19: Undefined type in pointer def 指针定义中未定义类型
error 20: Variable identifier expected 缺变量标识符
error 21: Error in type 类型错误
error 22: Structure too large 结构类型太长
error 23: Set ba type out of range 集合基类型越界
error 24: File components may not be files or objectsfile分量不能是⽂件或对象
error 25: Invalid string length ⽆效的字符串长度
error 26: Type mismatch 类型不匹配
error 27:error 27:Invalid subrange ba type ⽆效的⼦界基类型
error 28:Lower bound greater than upper bound 下界超过上界
error 29:Ordinal type expected 缺有序类型
error 30:Integer constant expected 缺整型常量
error 31:Constant expected 缺常量
error 32:Integer or real constant expected 缺整型或实型常量
error 33:Pointer Type identifier expected 缺指针类型标识符
error 34:Invalid function result type ⽆效的函数结果类型
error 35:Label identifier expected 缺标号标识符
error 36:BEGIN expected 缺BEGIN
error 37:END expected 缺END
error 38:Integer expression expected 缺整型表达式
error 39:Ordinal expression expected 缺有序类型表达式
error 40:Boolean expression expected 缺布尔表达式
error 41:Operand types do not match 操作数类型不匹配
error 42:Error in expression 表达式错误
error 43:Illegal assignment ⾮法赋值
error 44:Field identifier expected 缺域标识符
error 45:Object file too large ⽬标⽂件太⼤
error 46:Undefined external 未定义的外部过程与函数
error 47:Invalid object file record ⽆效的OBJ⽂件格式
error 48:Code gment too large 代码段太长
error 49:Data gment too large 数据段太长
error 50:DO expected 缺DO
error 51:Invalid PUBLIC definition ⽆效的PUBLIC定义
error 52:Invalid EXTRN definition ⽆效的EXTRN定义
error 53: Too many EXTRN definitions 太多的EXTRN定义
error 54:OF expected 缺OF
error 55:INTERFACE expected 缺INTERFACE
error 56:Invalid relocatable reference ⽆效的可重定位引⽤
error 57:THEN expected 缺THEN
error 58:TO or DOWNTO expected 缺TO或DOWNTO
error 59:Undefined forward 提前引⽤未经定义的说明
error 61:Invalid typecast ⽆效的类型转换
error 62:Division by zero 被零除
error 63:Invalid file type ⽆效的⽂件类型
error 64:Cannot read or write variables of this type 不能读写此类型变量
error 65:Pointer variable expected 缺指针类型变量
error 66:String variable expected 缺字符串变量
error 67:String expression expected 缺字符串表达式
error 68:Circular unit reference 单元UNIT部件循环引⽤
error 69:Unit name mismatch 单元名不匹配
error 70:Unit version mismatch 单元版本不匹配
error 71:Internal stack overflow 内部堆栈溢出
error 72:Unit file format error 单元⽂件格式错误
error 73:IMPLEMENTATION expected 缺IMPLEMENTATION
error 74:Constant and ca types do not match 常量和CASE类型不匹配
error 75:Record or object variable expected 缺记录或对象变量
error 76:Constant out of range 常量越界
error 77:File variable expected 缺⽂件变量
error 78:Pointer expression expected 缺指针表达式
error 79:Integer or real expression expected 缺整型或实型表达式
error 80:Label not within current block 标号不在当前块内
error 81:Label already defined 标号已定义
error 82:Undefined label in preceding statement part 在前⾯未定义标号
error 83:Invalid @ argument ⽆效的@参数
error 84:UNIT expected 缺UNIT
error 85: ";" expected 缺“;”
error 86: ":" expected 缺“:”
error 87: "," expected 缺“,”
error 88: "(" expected 缺“(”
error 89: ")" expected 缺“)”
error 90: "=" expected 缺“=”
error 91: ":=" expected 缺“:=”
error 92: "[" or "(." Expected 缺“[”或“(.”
error 93: "]" or ".)" expected 缺“]”或“.)”
error 94: "." expected 缺“.”
error 95: ".." expected 缺“..”
error 96:Too many variables 变量太多
error 97:Invalid FOR control variable ⽆效的FOR循环控制变量
error 98:Integer variable expected 缺整型变量
error 99:Files and procedure types are not allowed here 该处不允许⽂件和过程类型error 100:String length mismatch 字符串长度不匹配
error 101:Invalid ordering of fields ⽆效域顺序
error 102:String constant expected 缺字符串常量
error 103:Integer or real variable expected 缺整型或实型变量
error 104:Ordinal variable expected 缺有序类型变量
error 105:INLINE error INLINE错误
error 106:Character expression expected 缺字符表达式
error 107:Too many relocation items 重定位项太多
error 108:Overflow in arithmetic operation 算术运算溢出
error 112:CASE constant out of range CASE常量越界
error 113:Error in statement 表达式错误
error 114:Cannot call an interrupt procedure 不能调⽤中断过程
error 116:Must be in 8087 mode to compile this 必须在8087模式编译
error 117:Target address not found 找不到⽬标地址
error 118:Include files are not allowed here 该处不允许INCLUDE⽂件
error 119:No inherited methods are accessible here 该处继承⽅法不可访问
error 121:Invalid qualifier ⽆效的限定符
error 122:Invalid variable reference ⽆效的变量引⽤
error 123:Too many symbols 符号太多
error 124:Statement part too large 语句体太长
error 126:Files must be var parameters ⽂件必须是变量形参
error 127:Too many conditional symbols 条件符号太多
error 128:Misplaced conditional directive 条件指令错位
error 129:ENDIF directive missing 缺ENDIF指令
error 130:Error in initial conditional defines 初始条件定义错误
error 131:Header does not match previous definition 和前⾯定义的过程或函数不匹配error 133:Cannot evaluate this expression 不能计算该表达式
error 134:Expression incorrectly terminated 表达式错误结束
error 135:Invalid format specifier ⽆效格式说明符
error 136:Invalid indirect reference ⽆效的间接引⽤
error 137:Structured variables are not allowed here 该处不允许结构变量
error 138:Cannot evaluate without System unit 没有System单元不能计算
error 139:Cannot access this symbol 不能存取符号
error 140:Invalid floating point operation ⽆效的符号运算
error 141:Cannot compile overlays to memory 不能编译覆盖模块⾄内存
error 142:Pointer or procedural variable expected 缺指针或过程变量
error 143:Invalid procedure or function reference ⽆效的过程或函数调⽤
error 144:Cannot overlay this unit 不能覆盖该单元
error 146:File access denied 不允许⽂件访问
error 147:Object type expected 缺对象类型
error 148:Local object types are not allowed 不允许局部对象类型
error 149:VIRTUAL expected 缺VIRTUAL
error 150: Method identifier expected 缺⽅法标识符
error 151:Virtual constructors are not allowed 不允许虚构造函数
error 152:Constructor identifier expected 缺构造函数标识符
error 153:Destructor identifier expected 缺析构函数标识符
error 154:Fail only allowed within constructors 只能在构造函数内使⽤Fail标准过程
error 155:Invalid combination of opcode and operands 操作数与操作符⽆效组合
error 156:Memory reference expected 缺内存引⽤指针
error 157:Cannot add or subtract relocatable symbols 不能加减可重定位符号
error 158:Invalid register combination ⽆效寄存器组合
error 159:286/287 instructions are not enabled 未激活286/287指令
error 160:Invalid symbol reference ⽆效符号指针
error 161:Code generation error 代码⽣成错误
error 162:ASM expected 缺ASM
error 166:Procedure or function identifier expected 缺过程或函数标识符
error 167:Cannot export this symbol 不能输出该符号
error 168:Duplicate export name 外部⽂件名重复
error 169:Executable file header too large 可执⾏⽂件头太长
error 170:Too many gments 段太多
⼀、运⾏错误信息
运⾏错误分为四类:1-99为DOS错误;100-149为I/O错误,发⽣I/O后,如果使⽤了编译开关{$I+},程序将终⽌执⾏,否则编译开关为{$I-},程序继续执⾏,并由IOResult函数返回错误信息; 150-199为严重错误,200-255为致命错误,致命错误将⽴即终⽌程序执⾏。
错误代码及错误信息错误释义
error 1:Invalid function number ⽆效函数号
error 2:File not found ⽂件未找到
error 3:Path not found 找不到路径
error 4:Too many open files 打开⽂件太多
error 5:File access denied ⽂件不允许访问
error 6:Invalid file handle ⽆效⽂件句柄
error 12:Invalid file access code ⽆效⽂件存取代码
error 15:Invalid drive number ⽆效驱动器号
error 16:Cannot remove current directory 不能删除当前⽬录
error 17:Cannot rename across drives 不能跨驱动器改名
error 18:No more files 没有⽂件了
error 100:Disk read error 读磁盘错
error 101:Disk write error 写磁盘错
error 102:File not assigned ⽂件变量未赋值
error 103:File not open ⽂件未打开
error 104:File not open for input ⽂件未打开为写⽅式
error 105:File not open for output ⽂件未打开为读⽅式
error 106:Invalid numeric format ⽆效数值格式
error 150:Disk is write-protected 磁盘写保护
error 151:Bad drive request struct length 错误的驱动器请求结构长度
error 152:Drive not ready 驱动器未准备好
error 154:CRC error in data 数据CRC校验错
error 156:Disk ek error 磁盘定位错
error 157:Unknown media type 未知的介质类型
error 158:Sector Not Found 找不到扇区
error 159:Printer out of paper 打印机缺纸
error 160:Device write fault 设备写错误
error 161:Device read fault 设备读错误
error 162:Hardware failure 硬件故障
error 200:Division by zero 被零除
error 201:Range check error 范围检查出错
error 202:Stack overflow error 栈溢出
error 203:Heap overflow error 堆溢出
error 204:Invalid pointer operation ⽆效的指针操作
error 205:Floating point overflow 浮点运算上溢
error 206:Floating point underflow 浮点运算下溢
error 207:Invalid floating point operation ⽆效的浮点运算
error 208:Overlay manager not installed 未安装覆盖管理程序
error 209:Overlay file read error 读覆盖⽂件错误
error 210:Object not initialized 对象未初始化
error 211:Call to abstract method 调⽤抽象⽅法
error 212:Stream registration error 流注_册错误
error 213:Collection index out of range 集合下标越界
error 214:Collection overflow error 集合上溢
error 215:Arithmetic overflow error 算术运算上溢
error 216:General Protection fault ⼀般保护性错误
1. Warning 280:’i’:unreferenced local variable
说明局部变量i 在函数中未作任何的存取操作解决⽅法消除函数中i 变量的宣告
2 Warning 206:’Music3’:missing function-prototype
说明Music3( )函数未作宣告或未作外部宣告所以⽆法给其他函数调⽤
解决⽅法将叙述void Music3(void)写在程序的最前端作宣告如果是其他⽂件的函数则要写
成extern void Music3(void),即作外部宣告
3 Compling :C:\8051\MANN.C
Error:318:can’t open file ‘beep.h’
说明在编译C:\8051\MANN.C 程序过程中由于main.c ⽤了指令#i nclude “beep.h”,但
却找不到所致解决⽅法编写⼀个beep.h 的包含档并存⼊到c:\8051 的⼯作⽬录中
4 Compling:C:\8051\LED.C
Error 237:’LedOn’:function already has a body
说明LedOn( )函数名称重复定义即有两个以上⼀样的函数名称
解决⽅法修正其中的⼀个函数名称使得函数名称都是独⽴的
5 ***WARNING 16:UNCALLED SEGMENT,IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_DELAYX1MS?DELAY
说明DelayX1ms( )函数未被其它函数调⽤也会占⽤程序记忆体空间解决⽅法去掉
DelayX1ms( )函数或利⽤条件编译#if …..#endif,可保留该函数并不编译
6 ***WARNING 6 :XDATA SPACE MEMORY OVERLAP
FROM : 0025H
TO: 0025H
说明外部资料ROM 的0025H 重复定义地址
解决⽅法外部资料ROM 的定义如下Pdata unsigned char XFR_ADC _at_0x25 其中XFR_ADC 变量的名称为0x25,请检查是否有其它的变量名称也是定义在0x25 处并修正它
7 WARNING 206:’DelayX1ms’: missing function-prototype
C:\8051\INPUT.C
Error 267 :’DelayX1ms ‘:requires ANSI-style prototype C:\8051\INPUT.C
说明程序中有调⽤DelayX1ms 函数但该函数没定义即未编写程序内容或函数已定义但未作
宣告
解决⽅法编写DelayX1ms 的内容编写完后也要作宣告或作外部宣告可在delay.h 的包含档
宣告成外部以便其它函数调⽤
8 ***WARNING 1:UNRESOLVED EXTERNAL SYMBOL
SYMBOL:MUSIC3
MODULE:C:\8051\MUSIC.OBJ(MUSIC)
***WARNING 2:REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL:MUSIC3
MODULE:C:\8051\MUSIC.OBJ(MUSIC)
ADDRESS:0018H
说明程序中有调⽤MUSIC 函数但未将该函数的含扩档C 加⼊到⼯程档Prj 作编译和连接
解决⽅法设MUSIC3 函数在MUSIC C ⾥将MUSIC C 添加到⼯程⽂件中去
9 ***ERROR 107:ADDESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: _DATA_GOUP_
LENGTH: 0018H
***ERROR 118: REFERENCE MADE TO ERRONEOUS EXTERNAL
SYMBOL: VOLUME
MODULE: C:\8051\OSDM.OBJ (OSDM)
ADDRESS: 4036H
说明data 存储空间的地址范围为0~0x7f,当公⽤变量数⽬和函数⾥的局部变量如果存
储模式设为SMALL 则局部变量先使⽤⼯作寄存器R2~R7 作暂存当存储器不够⽤时则会
以data 型别的空间作暂存的个数超过0x7f 时就会出现地址不够的现象
解决⽅法将以data 型别定义的公共变量修改为idata 型别的定义
10.***WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?_WRITE_GMVLX1_REG?D_GMVLX1
CALLER1: ?PR?VSYNC_INTERRUPT?MAIN
CALLER2: ?C_C51STARTUP
***WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?_SPI_SEND_WORD?D_SPI
CALLER1: ?PR?VSYNC_INTERRUPT?MAIN
CALLER2: ?C_C51STARTUP
***WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?SPI_RECEIVE_WORD?D_SPI
CALLER1: ?PR?VSYNC_INTERRUPT?MAIN
CALLER2: ?C_C51STARTUP
该警告表⽰连接器发现有⼀个函数可能会被主函数和⼀个中断服务程序(或者调⽤中断
服务程序的函数)同时调⽤,
或者同时被多个中断服务程序调⽤。
出现这种问题的原因之⼀是这个函数是不可重⼊性函数,当该函数运⾏时它可能会被⼀
个中断打断,从⽽使得结果发⽣变化
并可能会引起⼀些变量形式的冲突(即引起函数内⼀些数据的丢失,可重⼊性函数在任何时
候都可以被ISR 打断,⼀段时间后⼜可以
运⾏,但是相应数据不会丢失)。
原因之⼆是⽤于局部变量和变量(暂且这样翻译,arguments,[⾃变量,变元⼀数值,⽤于
确定程序或⼦程序的值])的内存区被其他函数的内存区所覆盖,如果该函数被中断,则它的
内存区就会
被使⽤,这将导致其他函数的内存冲突。
例如,第⼀个警告中函数WRITE_GMVLX1_REG 在D_GMVLX1.C 或者D_GMVLX1.A51 被定义, 它被⼀个中断服务程序或者⼀个调⽤了中断
服务程序的函数调⽤了,调⽤它的函数是VSYNC_INTERRUPT,在MAIN.C 中。
解决⽅法:
如果你确定两个函数决不会在同⼀时间执⾏(该函数被主程序调⽤并且中断被禁⽌),并
且该函数不占⽤内存(假设只使⽤寄存器),
则你可以完全忽略这种警告。
如果该函数占⽤了内存,则应该使⽤连接器(linker)OVERLAY 指令将函数从覆盖分析(overlay analysis)中除去,例如:
OVERLAY (?PR?_WRITE_GMVLX1_REG?D_GMVLX1 ! *)
上⾯的指令防⽌了该函数使⽤的内存区被其他函数覆盖。如果该函数中调⽤了其他函数,
⽽这些被调⽤在程序中其他地⽅也被调⽤,
你可能会需要也将这些函数排除在覆盖分析(overlay analysis)之外。这种OVERLAY 指令能
使编译器除去上述警告信息。
如果函数可以在其执⾏时被调⽤,则情况会变得更复杂⼀些。这时可以采⽤以下⼏种⽅
法:
1.主程序调⽤该函数时禁⽌中断,可以在该函数被调⽤时⽤#pragma disable 语句来实现禁
⽌中断的⽬的。必须使⽤OVERLAY 指令将该函数
从覆盖分析中除去。
2.复制两份该函数的代码,⼀份到主程序中,另⼀份复制到中断服务程序中。
3.将该函数设为重⼊型。例如:
void myfunc(void) reentrant {
...
}
这种设置将会产⽣⼀个可重⼊堆栈,该堆栈被被⽤于存储函数值和局部变量,⽤这种
⽅法时重⼊堆栈必须在STARTUP.A51 ⽂件中配置。
这种⽅法消耗更多的RAM 并会降低重⼊函数的执⾏速度。
11. *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_COMPARE?TESTLCD

本文发布于:2023-05-08 19:15:16,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/100986.html

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

标签:函数   错误   变量   类型   不能
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图