C語言命語法錯(cuò)誤大全
fatalerrorC1004:unexpectedendoffilefound
未找到文件末尾(可能是括號(hào)匹配問題)
fatalerrorC1021:invalidpreprocessorcommand'1nclude'
無效的編譯預(yù)處理命令'1nclude'
fatalerrorC1083:Cannotopenincludefile:?'stdi.h':Nosuchfileordirectory
不能打開頭文件'stdi.h'耳舅,文件或文件夾不存在
errorC2101:?'&'onconstant
不能計(jì)算常量的地址
errorC2059:syntaxerror:?'while'
在'while'附近夏醉,存在語法錯(cuò)誤
errorC2061:syntaxerror:identifier'x'
標(biāo)識(shí)符x的附近送朱,存在語法錯(cuò)誤
errorC2065:?'i'?:undeclaredidentifier
變量i未定義
errorC2078:toomanyinitializers
數(shù)組/結(jié)構(gòu)等變量初始化時(shí)的數(shù)據(jù)太多
errorC2087:?'<Unknown>'?:missingsubscript
丟失數(shù)組下標(biāo)
errorC2106:?'='?:leftoperandmustbel-value
'='的左側(cè)應(yīng)當(dāng)是左值指黎,即不能是常量
errorC2115:?'='?:incompatibletypes
'='兩側(cè)的類型不兼容
errorC2133:?'a'?:unknownsize
a(可能是數(shù)組名)的大小不確定攘已。
errorC2137:emptycharacterconstant
空的字符常量
errorC2143:syntaxerror:missing';'before......
在......之前,缺少';'
errorC2146:syntaxerror:missing')'beforeidentifier'......'
在標(biāo)識(shí)符'......'之前缺少')'
errorC2181:illegalelsewithoutmatchingif
else缺少匹配的if
errorC2198:?'printf'?:toofewactualparameters
'printf'函數(shù)的參數(shù)太少
errorC2223:leftof'->x'mustpointtostruct/union
'->x'的左側(cè)應(yīng)是結(jié)構(gòu)類型變量或聯(lián)合類型變量
errorC2224:leftof'.x'musthavestruct/uniontype
'.x'的左側(cè)應(yīng)是結(jié)構(gòu)類型變量或聯(lián)合類型變量
errorC2371:?'f1'?:redefinition;differentbasictypes
函數(shù)'f1'的接口被重定義疚俱,參數(shù)類型或返回值類型不一致
warningC4101:?'x'?:unreferencedlocalvariable
'x'是一個(gè)從未被使用的局部變量
warningC4013:?'fi'undefined;assumingexternreturningint
函數(shù)'fi'未定義,假設(shè)其是外部函數(shù)甘穿,返回值類型是int
warningC4020:?'fun'?:toomanyactualparameters
調(diào)用'fun'函數(shù)時(shí),有太多的實(shí)參
warningC4033:?'f3'mustreturnavalue
函數(shù)'f3'應(yīng)當(dāng)有返回值語句
warningC4047:?'='?:?'int*'differsinlevelsofindirectionfrom'int'
賦值運(yùn)算中的類型轉(zhuǎn)換:從'int'轉(zhuǎn)換到'int*'可能存在問題
warningC4098:?'f2'?:?'void'functionreturningavalue
函數(shù)'f2'是無返回值的函數(shù)梢杭,竟然有返回值語句温兼。
warningC4133:?'function'?:incompatibletypes-from'...'to'...'
不兼容的類型轉(zhuǎn)換(從'...'類型向'...'類型)
warningC4244:?'initializing'?:conversionfrom'constdouble'to'int',possiblelossofdata
在初始化數(shù)據(jù)時(shí),類型轉(zhuǎn)換可能導(dǎo)致數(shù)據(jù)丟失
warningC4305:?'initializing'?:truncationfrom'constint'to'char'
初始化時(shí)武契,數(shù)據(jù)被截?cái)?/p>
warningC4700:localvariable'x'usedwithouthavingbeeninitialized
局部變量'x'在被使用之前未初始化募判,
errorLNK2001:unresolvedexternalsymbol_f5
f5從未定義
1. Ambiguous operators need parentheses —?不明確的運(yùn)算需要用括號(hào)括起
2. Ambiguous symbol 'xxx'?—?不明確的符號(hào)
3. Argument list syntax error —?參數(shù)表語法錯(cuò)誤
4. Array bounds missing —?丟失數(shù)組界限符
5. Array size toolarge —?數(shù)組尺寸太大
6. Bad character in paramenters —?參數(shù)中有不適當(dāng)?shù)淖址?/p>
7. Bad file name format in include directive —?包含命令中文件名格式不正確
8. Bad ifdef directive synatax —?編譯預(yù)處理ifdef有語法錯(cuò)
9. Bad undef directive syntax —?編譯預(yù)處理undef有語法錯(cuò)
10. Bit field too large —?位字段太長
11. Call of non-function —?調(diào)用未定義的函數(shù)
12. Call to function with no prototype —?調(diào)用函數(shù)時(shí)沒有函數(shù)的說明
13. Cannot modify a const object —?不允許修改常量對(duì)象
14. Case outside of switch —?漏掉了case?語句
15. Case syntax error — Case 語法錯(cuò)誤
16. Code has no effect —?代碼不可能執(zhí)行到
17. Compound statement missing{?—?分程序漏掉"{"
18. Conflicting type modifiers —?不明確的類型說明符
19. Constant expression required —?要求常量表達(dá)式
20. Constant out of range in comparison —?在比較中常量超出范圍
21. Conversion may lose significant digits —?轉(zhuǎn)換時(shí)會(huì)丟失意義的數(shù)字
22. Conversion of near pointer not allowed —?不允許轉(zhuǎn)換近指針
23. Could not find file 'xxx'?—?找不到XXX文件
24. Declaration missing ;?—?說明缺少";"
25. Declaration syntax error —?說明中出現(xiàn)語法錯(cuò)誤
26. Default outside of switch — Default 出現(xiàn)在switch語句之外
27. Define directive needs an identifier —?定義編譯預(yù)處理需要標(biāo)識(shí)符
28. Division by zero —?用零作除數(shù)
29. Do statement must have while — Do-while語句中缺少while部分
30. Enum syntax error —?枚舉類型語法錯(cuò)誤
31. Enumeration constant syntax error —?枚舉常數(shù)語法錯(cuò)誤
32. Error directive :xxx?—?錯(cuò)誤的編譯預(yù)處理命令
33. Error writing output file —?寫輸出文件錯(cuò)誤
34. Expression syntax error —?表達(dá)式語法錯(cuò)誤
35. Extra parameter in call —?調(diào)用時(shí)出現(xiàn)多余錯(cuò)誤
36. File name too long —?文件名太長
37. Function call missing )?—?函數(shù)調(diào)用缺少右括號(hào)
38. Fuction definition out of place —?函數(shù)定義位置錯(cuò)誤
39. Fuction should return a value —?函數(shù)必需返回一個(gè)值
40. Goto statement missing label — Goto語句沒有標(biāo)號(hào)
41. Hexadecimal or octal constant too large — 16進(jìn)制或8進(jìn)制常數(shù)太大
42. Illegal character 'x'?—?非法字符x
43. Illegal initialization —?非法的初始化
44. Illegal octal digit —?非法的8進(jìn)制數(shù)字
45. Illegal pointer subtraction —?非法的指針相減
46. Illegal structure operation —?非法的結(jié)構(gòu)體操作
47. Illegal use of floating point —?非法的浮點(diǎn)運(yùn)算
48. Illegal use of pointer —?指針使用非法
49. Improper use of a typedefsymbol —?類型定義符號(hào)使用不恰當(dāng)
50. In-line assembly not allowed —?不允許使用行間匯編
51. Incompatible storage class —?存儲(chǔ)類別不相容
52. Incompatible type conversion —?不相容的類型轉(zhuǎn)換
53. Incorrect number format —?錯(cuò)誤的數(shù)據(jù)格式
54. Incorrect use of default — Default使用不當(dāng)
55. Invalid indirection —?無效的間接運(yùn)算
56. Invalid pointer addition —?指針相加無效
57. Irreducible expression tree —?無法執(zhí)行的表達(dá)式運(yùn)算
58. Lvalue required —?需要邏輯值0或非0值
59. Macro argument syntax error —?宏參數(shù)語法錯(cuò)誤
60. Macro expansion too long —?宏的擴(kuò)展以后太長
61. Mismatched number of parameters in definition —?定義中參數(shù)個(gè)數(shù)不匹配
62. Misplaced break —?此處不應(yīng)出現(xiàn)break語句
63. Misplaced continue —?此處不應(yīng)出現(xiàn)continue語句
64. Misplaced decimal point —?此處不應(yīng)出現(xiàn)小數(shù)點(diǎn)
65. Misplaced elif directive —?不應(yīng)編譯預(yù)處理elif
66. Misplaced else —?此處不應(yīng)出現(xiàn)else
67. Misplaced else directive —?此處不應(yīng)出現(xiàn)編譯預(yù)處理else
68. Misplaced endif directive —?此處不應(yīng)出現(xiàn)編譯預(yù)處理endif
69. Must be addressable —?必須是可以編址的
70. Must take address of memory location —?必須存儲(chǔ)定位的地址
71. No declaration for function 'xxx'?—?沒有函數(shù)xxx的說明
72. No stack —?缺少堆棧
73. No type information —?沒有類型信息
74. Non-portable pointer assignment —?不可移動(dòng)的指針(地址常數(shù))賦值
75. Non-portable pointer comparison —?不可移動(dòng)的指針(地址常數(shù))比較
76. Non-portable pointer conversion —?不可移動(dòng)的指針(地址常數(shù))轉(zhuǎn)換
77. Not a valid expression format type —?不合法的表達(dá)式格式
78. Not an allowed type —?不允許使用的類型
79. Numeric constant too large —?數(shù)值常太大
80. Out of memory —?內(nèi)存不夠用
81. Parameter 'xxx' is never used —?能數(shù)xxx沒有用到
82. Pointer required on left side of ->?—?符號(hào)->的左邊必須是指針
83. Possible use of 'xxx' before definition —?在定義之前就使用了xxx(警告)
84. Possibly incorrect assignment —?賦值可能不正確
85. Redeclaration of 'xxx'?—?重復(fù)定義了xxx
86. Redefinition of 'xxx' is not identical — xxx的兩次定義不一致
87. Register allocation failure —?寄存器定址失敗
88. Repeat count needs an lvalue —?重復(fù)計(jì)數(shù)需要邏輯值
89. Size of structure or array not known —?結(jié)構(gòu)體或數(shù)給大小不確定
90. Statement missing ;?—?語句后缺少"咒唆;"
91. Structure or union syntax error —?結(jié)構(gòu)體或聯(lián)合體語法錯(cuò)誤
92. Structure size too large —?結(jié)構(gòu)體尺寸太大
93. Sub scripting missing ]?—?下標(biāo)缺少右方括號(hào)
94. Superfluous & with function or array —?函數(shù)或數(shù)組中有多余的"&"
95. Suspicious pointer conversion —?可疑的指針轉(zhuǎn)換
96. Symbol limit exceeded —?符號(hào)超限
97. Too few parameters in call —?函數(shù)調(diào)用時(shí)的實(shí)參少于函數(shù)的參數(shù)不
98. Too many default cases — Default太多(switch語句中一個(gè))
99. Too many error or warning messages —?錯(cuò)誤或警告信息太多
100. Too many type in declaration —?說明中類型太多
101. Too much auto memory in function —?函數(shù)用到的局部存儲(chǔ)太多
102. Too much global data defined in file —?文件中全局?jǐn)?shù)據(jù)太多
103. Two consecutive dots —?兩個(gè)連續(xù)的句點(diǎn)
104. Type mismatch in parameter xxx —?參數(shù)xxx類型不匹配
105. Type mismatch in redeclaration of 'xxx'?— xxx重定義的類型不匹配
106. Unable to create output file 'xxx'?—?無法建立輸出文件xxx
107. Unable to open include file 'xxx'?—?無法打開被包含的文件xxx
108. Unable to open input file 'xxx'?—?無法打開輸入文件xxx
109. Undefined label 'xxx'?—?沒有定義的標(biāo)號(hào)xxx
110. Undefined structure 'xxx'?—?沒有定義的結(jié)構(gòu)xxx
111. Undefined symbol 'xxx'?—?沒有定義的符號(hào)xxx
112. Unexpected end of file in comment started on line xxx —?從xxx行開始的注解尚未結(jié)束文件不能結(jié)束
113. Unexpected end of file in conditional started on line xxx —?從xxx?開始的條件語句尚未結(jié)束文件不能結(jié)束
114. Unknown assemble instruction —?未知的匯編結(jié)構(gòu)
115. Unknown option —?未知的操作
116. Unknown preprocessor directive:?'xxx'?—?不認(rèn)識(shí)的預(yù)處理命令xxx
117. Unreachable code —?無路可達(dá)的代碼
118. Unterminated string or character constant —?字符串缺少引號(hào)
119. User break —?用戶強(qiáng)行中斷了程序
120. Void functions may not return a value — Void類型的函數(shù)不應(yīng)有返回值
121. Wrong number of arguments —?調(diào)用函數(shù)的參數(shù)數(shù)目錯(cuò)
122.?'xxx' not an argument — xxx不是參數(shù)
123.?'xxx' not part of structure — xxx不是結(jié)構(gòu)體的一部分
124. xxx statement missing (?— xxx語句缺少左括號(hào)
125. xxx statement missing )?— xxx語句缺少右括號(hào)
126. xxx statement missing ;?— xxx缺少分號(hào)
127. xxx' declared but never used —?說明了xxx但沒有使用
128. xxx' is assigned a value which is never used —?給xxx賦了值但未用過
C語言編譯錯(cuò)誤信息錦集
說明:Turbo C 的源程序錯(cuò)誤分為三種類型:致命錯(cuò)誤届垫、一般錯(cuò)誤和警告。其中全释,致命錯(cuò)誤通常是內(nèi)部編譯出錯(cuò)装处;一般錯(cuò)誤指程序的語法錯(cuò)誤、磁盤或內(nèi)存存取錯(cuò)誤或命令行錯(cuò)誤等浸船;警告則只是指出一些得懷疑的情況妄迁,它并不防止編譯的進(jìn)行。
下面按字母順序A~Z分別列出致命錯(cuò)誤及一般錯(cuò)誤信息李命,英漢對(duì)照及處理方法:
(一)登淘、致命錯(cuò)誤英漢對(duì)照及處理方法:
A-B致命錯(cuò)誤
Bad call of in-line function (內(nèi)部函數(shù)非法調(diào)用)
分析與處理:在使用一個(gè)宏定義的內(nèi)部函數(shù)時(shí),沒能正確調(diào)用封字。一個(gè)內(nèi)部函數(shù)以兩個(gè)下劃線(__)開始和結(jié)束黔州。
Irreducable expression tree (不可約表達(dá)式樹)
分析與處理:這種錯(cuò)誤指的是文件行中的表達(dá)式太復(fù)雜,使得代碼生成程序無法為它生成代碼阔籽。這種表達(dá)式必須避免使用流妻。
Register allocation failure (存儲(chǔ)器分配失敗)
分析與處理:這種錯(cuò)誤指的是文件行中的表達(dá)式太復(fù)雜,代碼生成程序無法為它生成代碼仿耽。此時(shí)應(yīng)簡(jiǎn)化這種繁雜的表達(dá)式或干脆避免使用它合冀。
(二)、一般錯(cuò)誤信息英漢照及處理方法
#operator not followed by maco argument name(#運(yùn)算符后沒跟宏變?cè)?
分析與處理:在宏定義中项贺,#用于標(biāo)識(shí)一宏變串∏团校“#”號(hào)后必須跟一個(gè)宏變?cè)?/p>
’xxxxxx’ not anargument (’xxxxxx’不是函數(shù)參數(shù))
分析與處理:在源程序中將該標(biāo)識(shí)符定義為一個(gè)函數(shù)參數(shù)开缎,但此標(biāo)識(shí)符沒有在函數(shù)中出現(xiàn)。
Ambiguous symbol ’xxxxxx’?(二義性符號(hào)’xxxxxx’)
分析與處理:兩個(gè)或多個(gè)結(jié)構(gòu)的某一域名相同林螃,但具有的偏移奕删、類型不同。在變量或表達(dá)式中引用該域而未帶結(jié)構(gòu)名時(shí)疗认,會(huì)產(chǎn)生二義性完残,此時(shí)需修改某個(gè)域名或在引用時(shí)加上結(jié)構(gòu)名伏钠。
Argument # missing name (參數(shù)#名丟失)
分析與處理:參數(shù)名已脫離用于定義函數(shù)的函數(shù)原型。如果函數(shù)以原型定義谨设,該函數(shù)必須包含所有的參數(shù)名熟掂。
Argument list syntax error (參數(shù)表出現(xiàn)語法錯(cuò)誤)
分析與處理:函數(shù)調(diào)用的參數(shù)間必須以逗號(hào)隔開,并以一個(gè)右括號(hào)結(jié)束扎拣。若源文件中含有一個(gè)其后不是逗號(hào)也不是右括號(hào)的參數(shù)赴肚,則出錯(cuò)。
Array bounds missing (數(shù)組的界限符"]"丟失)
分析與處理:在源文件中定義了一個(gè)數(shù)組二蓝,但此數(shù)組沒有以下右方括號(hào)結(jié)束誉券。
Array size too large (數(shù)組太大)
分析與處理:定義的數(shù)組太大,超過了可用內(nèi)存空間刊愚。
Assembler statement too long (匯編語句太長)
分析與處理:內(nèi)部匯編語句最長不能超過480字節(jié)踊跟。
Bad configuration file (配置文件不正確)
分析與處理:TURBOC.CFG配置文件中包含的不是合適命令行選擇項(xiàng)的非注解文字。配置文件命令選擇項(xiàng)必須以一個(gè)短橫線開始鸥诽。
Bad file name format in include directive(包含指令中文件名格式不正確)
分析與處理:包含文件名必須用引號(hào)("filename.h")或尖括號(hào)()括起來商玫,否則將產(chǎn)生本類錯(cuò)誤。如果使用了宏衙传,則產(chǎn)生的擴(kuò)展文本也不正確决帖,因?yàn)闊o引號(hào)沒辦法識(shí)別。
Bad ifdef directive syntax (ifdef指令語法錯(cuò)誤)
分析與處理:#ifdef必須以單個(gè)標(biāo)識(shí)符(只此一個(gè))作為該指令的體蓖捶。
Bad ifndef directive syntax (ifndef指令語法錯(cuò)誤)
分析與處理:#ifndef 必須以單個(gè)標(biāo)識(shí)符(只此一個(gè))作為該指令的體地回。
Bad undef directive syntax (undef指令語法錯(cuò)誤)
分析與處理:#undef指令必須以單個(gè)標(biāo)識(shí)符(只此一個(gè))作為該指令的體。
Bad file size syntax (位字段長語法錯(cuò)誤)
分析與處理:一個(gè)位字段長必須是1—16位的常量表達(dá)式俊鱼。
Call of non-functin (調(diào)用未定義函數(shù))
分析與處理:正被調(diào)用的函數(shù)無定義刻像,通常是由于不正確的函數(shù)聲明或函數(shù)名拼錯(cuò)而造成。
Cannot modify a const object (不能修改一個(gè)長量對(duì)象)
分析與處理:對(duì)定義為常量的對(duì)象進(jìn)行不合法操作(如常量賦值)引起本錯(cuò)誤并闲。
Case outside of switch (Case?出現(xiàn)在switch外)
分析與處理:編譯程序發(fā)現(xiàn)Case語句出現(xiàn)在switch語句之外细睡,這類故障通常是由于括號(hào)不匹配造成的。
Case statement missing (Case語句漏掉)
分析與處理:Case語必須包含一個(gè)以冒號(hào)結(jié)束的常量表達(dá)式帝火,如果漏了冒號(hào)或在冒號(hào)前多了其它符號(hào)溜徙,則會(huì)出現(xiàn)此類錯(cuò)誤。
Character constant too long (字符常量太長)
分析與處理:字符常量的長度通常只能是一個(gè)或兩個(gè)字符長犀填,超過此長度則會(huì)出現(xiàn)這種錯(cuò)誤蠢壹。
Compound statement missing (漏掉復(fù)合語句)
分析與處理:編譯程序掃描到源文件未時(shí),未發(fā)現(xiàn)結(jié)束符號(hào)(大括號(hào))九巡,此類故障通常是由于大括號(hào)不匹配所致图贸。
Conflicting type modifiers (類型修飾符沖突)
分析與處理:對(duì)同一指針,只能指定一種變址修飾符(如near 或far);而對(duì)于同一函數(shù)疏日,也只能給出一種語言修飾符(如Cdecl偿洁、pascal或interrupt)。
免費(fèi)C/C++基礎(chǔ)丶進(jìn)階資料沟优,還有實(shí)踐課程免費(fèi)領(lǐng)涕滋,加群728483370