C Language Common errors in the English table

Source: Internet
Author: User
Tags comparison table

C Language Common errors in the English Control table (Web search and experience accumulation constantly updated)

Common mistakes in Chinese and English comparison table

Fatal error C1003:error count exceeds number; Stopping compilation

Chinese control: Too many errors, stop compiling

Parse: Modify the previous error and compile again

Fatal error c1004:unexpected end of file found

The file does not end analysis: a function or a struct definition is missing "}", or in a function call or expression, the parentheses are not paired, or the comment "/*...*/" is incomplete, etc.

Fatal error C1083:cannot open include file: ' xxx ': No such file or

Directory Chinese control: Unable to open header file xxx: No file or Path analysis: header file does not exist, or header file is misspelled, or file is read-only

Fatal error c1903:unable to recover from previous error (s); Stopping

Compilation: Unable to recover from the previous error, stop compiling the analysis: many reasons for causing the error, it is recommended to first modify the previous error

Error C2001:newline in constant

Chinese: Create a new row in a constant analysis: string constant Multiline writing

Error C2006: #include expected a filename, found ' identifier '

Chinese control: #include命令中需要文件名

Analysis: Typically the header file is not enclosed in a pair of double or angle brackets, such as "#include stdio.h"

Error C2007: #define Syntax

#define语法错误 Analysis: For example, "#define" after the missing macro name, such as "#define"

Error C2008: ' xxx ': unexpected in macro definition

Macro definition when there is an unexpected XXX analysis: macro definition when the macro name and the replacement string should have a space between, for example "#define TRUE" 1 ""

Error c2009:reuse of macro formal ' identifier '

Chinese control: Parameter re-use analysis with parameters: macro Definition If parameters cannot have duplicate names, such as "#define S (a,a) (a*a)", parameter a repeats

Error C2010:

' character ': unexpected in macro formal parameter list Chinese control: Parameter table with parameter macro shows unknown character

Analysis: For example "#define S (r|) r*r" parameter more than one character ' | '

Error C2014:preprocessor command must start as first nonwhite space

Pre-processing command only allowed spaces before

Analysis: Each preprocessing command should have a single line and no other non-whitespace characters should appear

Error C2015:too many characters in constant

Chinese control: Constants contain multiple characters

Analysis: There can be only one character in the single quotation mark of a character constant, or

An escape character that begins with "\"

Error C2017:illegal escape sequence

Escape character Illegal analysis: The escape character is generally outside the "or", for example "char error =" \ n; "

Error C2018:unknown character ' 0xhh '

Chinese control: Unknown character 0xhh analysis: Generally, a Chinese punctuation mark is entered, such as "char error = ' E ';"; "Chinese punctuation mark

Error c2019:expected preprocessor directive, found ' character '

Chinese control: Expecting preprocessing command, but having invalid characters

Analysis: Usually the # Number of pre-processing commands mistakenly enter other invalid characters, such as "#!define TRUE 1"

Error c2021:expected exponent value, not ' character '

Chinese comparison: Expected exponential value, cannot be character analysis: The index of floating-point number is usually the wrong way, for example, 123.456E

Error C2039: ' identifier1 ': is not a member of ' Idenifier2 '

Reference: identifier 1 is not a member of an identifier

Parsing: A program incorrectly invokes or refers to a struct, a common body, a member of a class

Error c2048:more than one default

More than one analysis of the default statement: The switch statement can only have one default, delete the redundant default

Error C2050:switch expression not integral

The switch expression is not an integer analysis: The switch expression must be an integer (or character type), such as "switch (" a ") in the expression is a string, which is illegal

Error C2051:case expression not constant

Case expression is not a constant analysis: The case expression should be a constant expression, such as "a" in "Case" a "" "A" is a string, which is illegal

Error C2052: ' type ': illegal type for CASE expression

Case expression Type Illegal parsing: Case expression must be an integer constant (including character type)

Error c2057:expected constant expression

Chinese comparison: expected constant expression analysis: Generally, the array length is defined as a variable, for example, "int n=10; int A; " Medium n is a variable and is illegal

Error c2058:constant expression is not integral

The constant expression is not an integer analysis: Generally, the array length is not an integer constant when the array is defined

Error c2059:syntax error: ' xxx '

Chinese control: ' xxx ' syntax error analysis: Causes a lot of errors, may add more or less the symbol XXX

Error c2064:term does not evaluate to a function

Chinese control: Unrecognized function language analysis: 1, the function parameter is wrong, the expression may be incorrect, for example "sqrt (S (s-a) (s-b) (s-c)); Incorrect expression in

2. The variable has the same name as the function or the identifier is not a function, such as "int i,j; J=i (); " Medium I is not a function

Error C2065: ' xxx ': undeclared identifier

Common connection Errors

(1) VC network Programming encountered a compilation problem, the original is less WSOCK32.LIB.

Add the library WSOCK32.LIB to the Project-->settings-->link-->object/library modules.

In the VC in the development of the Winsock API programming, you need to use the following three files in the project, or there will be a compilation error.

1. WINSOCK. H: This is the header file for the Winsock API and needs to be included in the project.

2. WSOCK32. Lib:winsock API Connection library file. In use, be sure to include it in the project file as a non-default connection library for the project.

3. WINSOCK. Dll:winsock's dynamic Connection library, located under the Windows installation directory.

--------------------Configuration:example1-win32 Debug--------------------

Linking ...

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

(2) VC database SQL Programming encountered a problem, the original is less odbc32.lib.

Add the library odbc32.lib to the Project-->settings-->link-->object/library modules.

The MFC program called the ODBC API and connected with an error:

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

(3) VC OPENCV image processing programming encountered a problem, the original is less cv.lib cvaux.lib cxcore.lib highgui.lib.

Add a library cv.lib cvaux.lib in project-->settings-->link-->object/library modules

Cxcore.lib Highgui.lib can be.

Error lnk2001:unresolved external symbol _cvreleaseimage

Error lnk2001:unresolved external symbol _cvwaitkey

Error lnk2001:unresolved external symbol _cvdrawcontours

Error lnk2001:unresolved external symbol _cvreleasememstorage

Error lnk2001:unresolved external symbol _cvdestroywindow

Error lnk2001:unresolved external symbol _cvfindcontours

Error lnk2001:unresolved external symbol _cvcvtcolor

Error lnk2001:unresolved external symbol _cvcreateimage

Error lnk2001:unresolved external symbol _cvgetsize

Error lnk2001:unresolved external symbol _cvshowimage

Error lnk2001:unresolved external symbol _cvloadimage

Error lnk2001:unresolved external symbol _cvnamedwindow

Error lnk2001:unresolved external symbol _cvcreatememstorage

(4) VC OpenGL three-dimensional programming encountered a problem, the original is less OpenGL32.lib GLu32.lib GLaux.lib.

Add a library OpenGL32.lib GLu32.lib in project-->settings-->link-->object/library modules

GLaux.lib can be.

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

Error lnk2001:unresolved external symbol [email protected]

(5) VC VFW Video acquisition programming encountered a problem, the original is less VFW32.Lib

Add the library VFW32.Lib to the Project-->settings-->link-->object/library modules.

Error lnk2001:unresolved external symbol [email protected]

Chinese control: undefined identifier XXX Analysis: 1, if xxx for cout, cin, scanf, printf, sqrt, etc., the program contains the wrong header file

2, undefined variables, arrays, function prototypes, etc., pay attention to spelling errors or case sensitivity.

Error C2078:too Many initializers

Chinese control: Excessive initial value analysis: Generally, the number of initial values when initializing an array is greater than the array length, for example "int b={1,2,3};"

Error c2082:redefinition of formal parameter ' xxx '

Chinese control: Repeating definition formal parameter XXX analysis: The formal parameter in the first part of a function cannot be

is defined again in the

Error c2084:function ' xxx ' already has a body

Chinese control: defined function XXX Analysis: In the VC + + earlier version of the function can not be the same name, 6.0 supports the overloaded function, the function names are the same but the parameters are different

Error C2086: ' xxx ': redefinition

Chinese control: identifier XXX redefinition analysis: variable name, array name duplicate

Error C2087: ' <Unknown> ': missing subscript

Chinese control: Subscript Unknown Analysis: Generally, when defining a two-dimensional array, the length of the second dimension is not specified, such as "int a["; "

Error C2100:illegal indirection

Illegal indirect access operator "*" Analysis: Use "*" for non-pointer variables

Error C2105: ' operator ' needs l-value

Chinese control: operator requires Lvalue analysis: for example "(a+b) + +;" Statement, the "+ +" operator is invalid

Error C2106: ' operator ': left operand must is L-value

Chinese control: The left operand of the operator must be an lvalue analysis: for example "a+b=1;" Statement, the left value of the "=" operator must be a variable and cannot be an expression

Error C2110:cannot Add pointers

Chinese control: Two pointers can not be added analysis: for example, "int *pa,*pb,*a; A = pa + pb; " The "+" operation cannot be performed in two pointer variables

Error C2117: ' xxx ': array bounds overflow

Chinese control: Array xxx boundary overflow analysis: The character array is generally initialized when the string length is greater than the character array length, for example "char str =" ABCD; "

Error c2118:negative subscript or subscript is too large

Chinese control: subscript is negative or subscript too large analysis: typically an array is defined or an array element is referenced when the label is incorrect

Error c2124:divide or mod by zero

Chinese control: by 0 or to 0 redundancy analysis: for example, "int i = 1/0;" Divisor is 0

Error C2133: ' xxx ': unknown size

Chinese control: Array xxx length unknown analysis: Generally, the definition of the array is not initialized or the array length is not specified, for example, "int a[";

Error C2137:empty character constant.

The character type constant is NULL analysis: A pair of single quotation marks "" "can not have any characters

Error C2143:syntax error:missing ' token1 ' before ' token2 ' ERROR C2146:

Syntax error:missing ' token1 ' before identifier ' identifier '

Chinese control: Missing language symbol 1 analysis: "{", ")" or ";" and other language symbols before identifier or language symbol 2

Error C2144:syntax error:missing ') ' before type ' xxx '

Analysis: The type of argument that is usually defined when a function call is missing ') ' before XXX type

Error C2181:illegal else without matching if

Illegal no Else analysis matching if: may have added ";" or compound statement did not use "{}"

Error C2196:case value ' 0 ' already used

Case value 0 Used analysis: The value of a constant expression cannot recur

Error C2296: '% ': illegal, left operand have type ' float ' error C2297: '% '

: illegal, right operand have type ' float ' Chinese control:% operation of the left (rvalue) operand of type float, which is illegal

Analysis: The object for the remainder operation must be of type int, the variable type should be defined correctly, or the coercion type conversion should be used

Error C2371: ' xxx ': redefinition; Different basic types

Chinese control: identifier XXX redefinition; base type different analysis: Define variables, arrays, etc. with duplicate names

Error C2440: ' = ': cannot convert from ' char ' to ' char '

Assignment operation, unable to convert from character array to character analysis: Character data cannot be assigned by string or character array, more generally, type cannot be converted

Error c2447:missing function header (Old-style formal list?) Error C2448:

' <Unknown> ': Function-style initializer appears to be a function definition

Chinese control: Missing function title (is it an old-fashioned form table?) ) Analysis: The function is not defined correctly, the "()" in the first part of the functor is followed by a semicolon or a formal parameter list of the old-fashioned C language

Error c2450:switch expression of type ' xxx ' is illegal

switch expression is illegal XXX type analysis: switch expression type should be int or char

Error C2466:cannot allocate an array of constant size 0

Chinese control: Cannot allocate array analysis with length 0: array length is usually 0 when array is defined

Error C2601: ' xxx ': local function definitions is illegal

Chinese control: function XXX definition Illegal analysis: It is generally defined in the function body of a function of another function

Error C2632: ' type1 ' followed by ' type2 ' is illegal

Chinese control: Type 1 followed by Type 2, which is an illegal analysis: for example "int float i;" Statement

Error C2660: ' xxx ': function does not take n parameters

Chinese control: function XXX cannot take n parameter analysis: The number of arguments is incorrect when calling a function, for example "sin (x, y);"

Error c2676:binary ' << ': ' Class istream_withassign ' does not define this

operator or a conversion to a type acceptable to the predefined operator error

C2676:binary ' >> ': ' Class ostream_withassign ' does not define this operator

or a conversion to a type acceptable to the predefined operator

Analysis: The ">>", "<<" operators use errors, such as "cin<<x;

cout>>y; "

Error C4716: ' xxx ': Must return a value

Chinese control: function XXX must return a value analysis: A return command with no return value can be used only when the function type is void.

Fatal error Lnk1104:cannot Open file "Debug/cpp1.exe"

Chinese comparison:

Unable to open file Debug/cpp1.exe parse: Recompile link

Fatal error Lnk1168:cannot open Debug/cpp1.exe for writing

Chinese control: Can't open Debug/cpp1.exe file analysis: Generally Cpp1.exe is still running, not closed

Fatal error Lnk1169:one or more multiply defined symbols found

Chinese control: One or more multi-definition symbols appear.

Analysis: Generally with error LNK2005 appear together

Error lnk2001:unresolved external symbol _main

Chinese control: Unhandled external identity Main analysis: The general is the main spelling error, such as "Void Mian ()"

Error LNK2005: _main already defined in Cpp1.obj

The main function has been defined in the Cpp1.obj file: The previous program's workspace was not closed, causing multiple main functions to appear

Warning c4067:unexpected tokens following preprocessor directive-expected

A newline: Unexpected sign after preprocessing command-expecting new line analysis: "#include <iostream.h>;" ";" for extra characters after the command

Warning C4091: ": Ignored on left of ' type ' when no variable is

Declared: Ignore type description parsing when no variables are declared: statement "INT;" No variable is defined and does not affect program execution

Warning C4101: ' xxx ': unreferenced local variable

The variable XXX defines but does not use the analysis: can remove the definition of the variable, does not affect program execution

Warning C4244: ' = ': Conversion from ' type1 ' to ' type2 ', possible loss of

Data Control: Assignment operation, conversion from data type 1 to data type 2, may be lost

Analysis: The variable type must be correctly defined, data type 1 is float or double, data type 2 is int, the result may be incorrect, data type 1 is double, data type 2 is float, do not affect program results, you can ignore the warning

Warning C4305: ' Initializing ': Truncation from ' const double ' to ' float '

Chinese control: Initialize, intercept double-precision constant is float type

Analysis: Occurs when assigning a value to a float type variable, generally does not affect the final result

Warning C4390: '; ': empty controlled statement found; Is this the intent?

Chinese control: '; ' control statement is an empty statement, is the intention of the program? Analysis: The loop body of a branch or loop control statement for an If statement is an empty statement, usually with extra ";"

Warning C4508: ' xxx ': function should return a value; ' void ' return type

Assumed: function XXX should return a value, assuming the return type is void Analysis: the type of the main function is not defined as void and does not affect program execution

Warning C4552: ' operator ': operator has no effect; Expected operator with

Side-effect: operator has no effect; operators expecting side effects

Analysis: for example "I+J;" Statement, the "+" operation has no meaning

Warning C4553: ' = = ': operator has no effect; Did you intend ' = '?

Chinese comparison:

the "= =" operator is invalid; is "="? Analysis: for example

"I==J;"

Statement, the "= =" operation has no meaning

Warning c4700:local variable ' xxx ' used without having been initialized

Chinese control: variable xxx is not initialized before use

Analysis: The variable is not assigned a value, the result may be incorrect, if the variable is assigned by the SCANF function, it is possible to omit the "&" operator, or the variable is assigned through CIN, the statement is wrong

Warning C4715: ' xxx ': Not all control paths return a value

Chinese control: function xx Not all control paths have return value analysis: Generally, the IF statement of the function contains a return statement, when the condition of the IF statement does not set the return value

Warning C4723:potential divide by 0

Chinese control: It is possible to divide the analysis by 0: The expression value of 0 cannot be used as a divisor

Category: Learning from C + +

C Language Common errors in the English table

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.