|
Tools BCC CHMOD CL COFF2OMF COFFIMPLIB DMC DIFF DIFFDIR DUMP DUMPOBJ DUMPEXE EXE2BIN FLPYIMG GREP HC IMPLIB LIB LIBUNRES MAKE MAKEDEP ME OBJ2ASM PATCHOBJ RC RCC SC SHELL SMAKE TOUCH UNMANGLE WHEREIS Compiling Compiling Code C Implementation C++ Implementation Language Extensions Mixing Languages Assembly Language Inline Assembler Optimizing Code Numerics Programming Regular Expressions Acrtused Pragmas Precompiled Headers Predefined Macros Warning Messages Error Messages Runtime Messages Linking Optlink Switches Module Definition Files Operation and Design Error Messages Win32 Programming Win32 Programming DOS and Win16 Programming Memory Models 16 Bit Pointer Types and Type Modifiers Handle Pointers DOS DOS 32 (DOSX) Win16 Win16 DLLs Win16 Prolog/Epilog Virtual Memory For 640Kb DOS C/C++ Extensions Contract Programming __debug statement __debug declaration Dynamic Profiling Embedding C in HTML Porting to DMC++ Switching to DMC++ from Microsoft from Borland Porting Guide |
Compiler Error MessagesThis chapter lists and describes the error and warning messages generated by the compiler. Use this reference to:
Messages marked C are generated only by the C compiler (SC). Messages marked Warning indicate code that may not execute as you expect but that does compile. This appendix lists messages in alphabetical order. Some descriptions contain a margin note that refers to sections in one of these books; the sections contain information relevant to the cause of the error:
What's in This Chapter
Recognizing Compiler Error MessagesWhen the compiler encounters a line in source code that it does not understand, it prints that line with a message. For example:a= b; ^ file.c(15) Error: undefined identifier 'a'The caret (^) does not indicate what causes a problem but where the compiler recognizes a problem. If the caret points to a macro, try compiling the file using the Show Results of Preprocessor (-e command line option) to see which part of the macro is causing the error. The message under the caret starts with the name of the file, the line number where the problem occurs, and whether the message is an error or a warning. The rest of the message identifies what the compiler considers as the problem. Error Message TypesThere are seven error message types. Each message usually contains specific information about the problem.Command line errorsCommand line errors result from incorrect command line options or parameters. For a quick way to find an online summary of command line options and parameters, type sc from the DOS prompt.Lexical errorsLexical errors occur when the compiler encounters an unidentified or incomplete token. While they do not immediately terminate compilation, lexical errors do prevent the compiler from generating executable code. An error log tracks lexical errors.Preprocessor errorsErrors can occur in one of the preprocessing directives. While they do not immediately terminate compilation, preprocessor errors can prevent the compiler from generating executable code.Syntax errorsWhile they do not immediately terminate compilation, syntax errors can prevent the compiler from generating executable code. The compiler normally lists four errors of the preprocessor, syntax, lexical types before exiting. Use the -x option to let compilation continue to the end of the source file before exiting with an error.WarningsWarnings occur when the compiler finds a statement that is legitimate but probably not what you intended. Warnings are not errors and do not terminate compilation or prevent the compiler from generating code.Fatal errorsFatal errors immediately terminate compilation. A typical fatal error occurs when the compiler runs out of memory.Internal errorsInternal errors, a class of fatal error, take the following form:file/line #An assertion failure within the compiler generates this type of error. The error number is useful only in designating where in the compiler code the error occurs. The cause of this message may be an error in source code that the compiler cannot handle intelligently or a bug in the compiler itself. If your code generates this type of error, report it to Digital Mars, even if your code causes the error. Reporting the problem enables Digital Mars to improve error reporting in future releases. How to report an internal errorBefore reporting an internal error to technical support, try to isolate the error in a small program fragment. Use the following procedure:
C and C++ Compiler Error MessagesThis is a list of error messages the compiler may generate. Remember, only the C++ compiler generates messages marked C++ and only the C compiler generates messages marked C. Only the Inline Assembler generates messages marked Inline Assembler.'identifier' is a member of 'identifier' and 'identifier'Inline Assembler. The member appears in more than one struct; you need to specify which is correct.'identifier' is a pure virtual functionC++. The compiler cannot directly call a pure virtual function.'identifier' is already definedThe object is already declared.'identifier' is a virtual base class of 'identifier'C++. You cannot convert a pointer to a virtual base class into a pointer to a class derived from it. Also, you cannot create a pointer to a member of a virtual base class. For example:
class virtual_class
{ public:
int x;
};
class sub_class : virtual public virtual_class { };
void main()
{
virtual_class *v;
sub_class *s;
int virtual_class::*i;
s = (sub_class *) v; // error
i = &sub_class::x;
}
'identifier' is farC++. A near reference cannot apply to far data.'identifier' is not a class templateC++. The compiler expects to find the name of a class template but doesn't find one. If you are declaring a template member function, make sure the function's class name is a template. If you use a type of the form foo< bar>, make sure you declare as a template the class name before the less-than sign.'identifier' is not a constructorC++. You can use a member initialization list only when you're defining base constructors and member initializers. For example:
struct base { base(int); };
struct other { other(int); };
class sub : base
{ sub(int); // A constructor.
sub2(int); // Just a method.
other o;
};
sub::sub(int a) : o(a), base(a) { }// OK
sub::sub2(int a): o(a), base(a) { }// ERROR
See ARM 12.6.2 for more information.
'identifier' is not a correct struct, union or enum tag identifierThe struct, union, or enum includes invalid characters or is already defined.'identifier' is not a member of enum 'identifier'member identifier is not a member of this enum. Make sure to correctly spell the member name and that the member actually belongs to the enum with which you're using it.'identifier' is not a member of struct 'identifier'The member identifier is not a member of this class, struct or union. Make sure to correctly spell the member name and that the member actually belongs to the struct with which you're using it. If the member is for a different struct but you want to use it with this struct anyway, cast the struct. Also check for a class member function that is forward referenced. For example:
class X; // Forward reference
class Y { // Declaration
void g();
/* . . . */
};
class Z {
friend void X::f(); // ERROR
friend void Y::g(); // OK
};
See ARM 11.4 for more information
'identifier' is not a member of forward referenced struct 'identifier'You need to define a struct before referencing its members.'identifier' is not a struct or a classC++. You can derive new classes only from a class or a struct. It is not possible, for instance, to derive a class from a union.'identifier' is not in function parameter listThe parameter identifier is not listed as a parameter to the function in the function definition.'identifier' is not a variableThe identifier is not declared as a variable. Make sure you spell the name correctly.'identifier' must be a base classC++. When naming a member of a base class in a derived class declaration, qualify the member with a base class identifier. For example:
class other;
class base
{
private: /* . . . */
};
class sub : base
{ public:
other::a; // ERROR: other must be a
/* ... */ // base class of sub.
};
'identifier' must be a class name preceding '::'C++. The identifier before the double colon operator must be either a class, a struct, or a union.'identifier' must be a public base class of 'identifier'C++. When you use the syntax p->class::member, class must be a public base class member of the class to which p is referring. For example:
class public_base
{ public:
int x;
};
class other_class
{ public:
int z;
};
class sub : public public_base
{ /* ... */
};
void main()
{
sub *s;
s->public_base::x = 1; // OK
s->other_class::z = 1; // ERROR
}
'identifier' previously declared as something elseYou previously declared the identifier as another type. For example, you may have used a function without declaring it, so the compiler automatically declares it as a function returning an int. Now you declare that function to be something else.identifier storage class is illegal in this contextCheck for one of the following:
register int global; // ERROR: Can't declare global
// variable as register.
void f()
{
template<class T> T ave(T* a, int size)
{
// ERROR: Can't declare template // in a function.
}
/* ... */
}
See ARM 14.1 for more information.
number actual arguments expected for identifier, had numberWarning. The compiler expects a different number of arguments for the function or template. You may be incorrectly using the function, or you may be calling a function with a variable number of arguments without including its header file.number exceeds maximum of number parametersThe compiler does not support macros with more than 251 parameters.number operands expected for the identifier instructionInline Assembler. The instruction includes an incorrect number of operands.':' expectedThe compiler expects a colon after a constant expression in a case statement and after the keywords public, private, and protected in a class declaration.'::' or '(' expected after class 'identifier'C++. The compiler expects two colons or an open parenthesis after a class name in an expression. Casting, however, does not allow two colons. For example:class x; f= *(x*)y; ';' expectedThe compiler expects a semicolon at the end of a statement.',' expectedMake sure parameters are separated by commas.']' expectedThe compiler expects a close bracket at the end of an array declaration or reference.'(' expectedThe compiler expects the expression after the if, while, or for keywords to be enclosed in parentheses.')' expectedThe compiler expects a set of parentheses to be closed. Check for a pair of mismatched parentheses or a bad expression.'{' expectedThe compiler expects an open brace.'}' expectedThe compiler expects a close brace.'{' or tag identifier expectedThe compiler expects a tag name or an open brace to follow the keywords struct, class, union, and enum.'=', ';' or ',' expectedA variable is declared incorrectly. A declaration, must include an equals sign, a semicolon, or a comma after the variable name.// comments are not ANSI CC. The Enforce ANSI Compatibility option in the IDDE (the -A command line option) is on, but the program is using C++ style comments. C++-style comments begin with two slashes.## cannot appear at beginning or endThe double-number sign operator cannot appear at the beginning or end of a list of tokens. The operator must be between two tokens. For example, a ## b.See ANSI 3.8.3.3 for more information. # must be followed by a parameterThe number sign operator must appear only in front of a macro parameter. For example, #c.See ANSI 3.8.3.2 for more information. '#else' or '#elif' found without '#if'More #else or #elif preprocessor directives appear than preceding #if, #ifdef, or #ifndef directives.'#endif' found without '#if'More #endif preprocessor directives appear than preceding #if, #ifdef, or #ifndef directives.#include <typeinfo.h> in order to use RTTITo compile with run-time type identification, you need to include the <typeinfo.h> header file.#pragma pack(pop) does not have corresponding pushEvery #pragma pack(pop) directive requires a corresponding #pragma pack(push) directive.'<' expected following castC++. A type id enclosed in angle brackets (<>) is expected following static_cast, const_cast, reinterpret_cast, or dynamic_cast.See ARM 5.2 for more information. '<' expected following 'identifier'C++. In a class or function template, the argument list must be between angle brackets.See ARM 14.1 for more information. '>' expectedA type id enclosed in angle brackets (<>) is expected following static_cast, const_cast, reinterpret_cast, or dynamic_cast.See ARM 5.2 for more information. 0 expectedC++. A pure virtual function is declared incorrectly. The following is the syntax for a pure virtual function:
class X
{ virtual pure_virtual_func() = 0; // OK
/* ... */
};
0 or 1 expectedOnly binary digits can follow the characters 0b. No spaces should be between the b and the number.a '...' handler must be the last one for a try-blockC++. catch(...) must appear as the last catch in a list of catch handlers for a try-block.See ARM 15.3 for more information. a catch must follow a try-blockC++. The syntax for a catch is:
try { statements } catch (exception-decl) { statements }
See ARM 15.1 for more information.
access declaration must be in public or protected sectionC++. A class member's access can change only if that class member is in a public or protected section. For example:
class base
{ int a;
public:
int x;
};
class sub : private base
{ base::a; // ERROR
public:
base::x; // OK: x is public
};
a derived class member has the same name identifierC++. A base member's access cannot change when a derived class defines a member with the same name. For example:
class base
{ public:
int x, y;
/* ... */
};
class sub : base
{ public:
void x();
base::x; // ERROR: same name as x()
base::y; // OK
};
See ARM 11.3 for more information.
alignment must be a power of 2Alignment for structure members must be 1, 2, 4, 8, and so on.alloca() cannot be used in Windows functionsThe alloca() function requires the setup of a special stack frame. That frame conflicts with the stack frames that Windows requires.already seen initializer for 'identifier'C++. Either more than one member-initializer for the identifier exists, or more than one initializer for the base class exists. For example:
class base
{ int x;
base(int);
};
class sub : base
{ base b;
sub(int);
};
sub::sub(int a) :
base(a + 1), // OK
b(a * 2), // OK
base(a - 2) // ERROR
{
x = a;
}
ambiguous reference to base class 'identifier'C++. This class has more than one base class, and it is not clear to which the program is referring.See ARM 11.3 for more information. ambiguous reference to functionC++. In calling an overloaded function, more than one definition of the function matches the call. For example:
struct X
{ X(int);
};
struct Y
{ Y(int);
};
void f(X); // f() can take an argument of
void f(Y); // either type X or type Y.
void main()
{
f(1); // ERROR: Ambiguous,
// f(X(1)) or f(Y(1))?
f(X(1)); // OK
f(Y(1)); // OK
}
ambiguous type conversionC++. The compiler cannot find an unambiguous type conversion. For example:
struct X
{ operator int();
operator void*();
};
void main()
{
X x;
if (x)
; // ERROR
if ((int) x)
; // OK
if ((void*) x)
; // OK
}
argument of type 'identifier' to copy constructorC++. Copy constructors for class X cannot take an argument of type X. Instead, use the reference to X.See ARM 12.1 for more information. argument to postfix ++ or --must be intC++. Only declarations of the following form can declare overloaded functions for the prefix and postfix operators ++ and --:operator ++() operator ++(int) operator --() operator --(int)See ARM 13.4.7 for more information. array dimension must be > 0A negative number or zero cannot act as an array dimension when declaring an array.See ANSI 3.5.4.2 for more information. array of functions is illegalAn array of pointers to functions, not an array of functions, can be declared. For example, instead of this:int (x[10])(); // ERROR: an array of functions// returning int use this: int (*x[10])(); // OK: an array of pointers to // functions returning int array of functions or refs is illegalC++. An array of pointers to functions, not an array of functions, can be declared. For example, instead of this:int (&x[10])(); // ERROR: an array of functions // returning intuse this: int (*x[10])(); // OK: an array of pointers to // functions returning intSee ARM 8.4.3 for more information. array or pointer required before '[ 'The brackets operator can only follow an array or pointer identifier.assembler opcode expectedInline Assembler. If the ASM keyword is being used, an assembler opcode or a label should start each instruction.assignment to 'this' is obsolete, use X::operator new/deleteWarning. C++. Avoid performing storage management by assigning to this. Instead, overload the operators new and delete. Assigning to this is not part of the latest definition of C++, and future compilers may not support it.at least one parameter must be a class or a class&C++. An operator overloaded function that is not a class member must have at least one parameter that is a class or class reference.bad -D switch, identifierThe command line macro definition is invalid.bad file name 'filename'The filename is invalid.bad member-initializer for 'identifier'C++. A syntax error exists in the base class initializer for the class identifier. For example:
struct base
{ base(int);
};
struct sub : base
{ sub(int);
int var;
};
sub::sub(int a) : base(a),, var(a) { } // ERROR: Extra comma
base class 'name' has different ambient memory modelC++. The base class name is declared as __far, and a subclass of name is declared as __near, or visa versa. Change either declaration to match the other.The following code will cause this error:
class __far base { };
class __near sub : public base { };
binary exponent part required for hex floating constantsThe exponent is missing from a hexadecimal floating-point constant. A hexadecimal floating point constant comprises an optional sign, the 0x prefix, a hexadecimal significand, the letter p to indicate the start of the exponent, a binary exponent, and an optional type specifier. These are valid hexadecimal floating-point constants:0x1.FFFFFEp127f 0x1p-23 -0x1.2ACp+10C++. A bit field cannot occur in an anonymous union. A named union can have a bit field. blank arguments are illegalArguments are missing from a macro reference that is defined to take them. For example:#define TWICE(x) (x + x) TWICE(10) // OK TWICE() // ERROR 'break' is valid only in a loop or switchThe break statement can occur only within a for, while, switch, or do/ while statement.can only delete pointersC++. The delete operator works only on pointers. Use delete on a pointer to an object and not the object itself.can't assign to const variableA new value is assigned to a const variable. Remove the assignment or remove the restriction from the variable.can't build filespec 'filename'The named file cannot write to disk, probably because the disk is full.can't declare member of another class identifierC++. In a class declaration, a class name modifies a member function name. For example:
class X
{ void func_in_X();
};
class Y
{
void X::func_not_in_X(); // ERROR
int func_in_Y(); // OK
};
can't handle constructor in this contextC++. It is illegal to have a constructor as a default function parameter. For example:
class X
{ public:
X(int);
};
void foo(X = X(1)); // ERROR: X(1) is a
// constructor.
can't have unnamed bit fields in unionsIt is illegal to use an unnamed bit field in a union. Use a named bit field or remove the bit field.can't open response fileThe compiler cannot open the response file specified on the command line. Ensure that the file exists and that the correct path is specified.can't pass const/volatile object to non-const/volatile member functionC++. An object declared as const or volatile is trying to call a member function that is not. Declare the member function const or volatile, or remove the restriction from the object. For example:
struct A
{ int regular_func();
int const_func() const;
};
void main()
{
const A const_obj;
A regular_obj;
const_obj.regular_func(); // ERROR
const_obj.const_func(); // OK
regular_obj.const_func(); // OK
regular_obj.regular_func(); // OK
}
can't return arrays, functions or abstract classesC++. A function cannot return an array, function, or abstract class. However, a function can return a pointer to an array or a pointer to a function. For example:typedef char ARRAY[256]; ARRAY func_returning_array(); // ERROR ARRAY *func_returning_ptr_to_array(); // OK can't take address of register, bit field, constant or stringIt is not possible to take the address of a register variable, a bit field in a structure, a constant, or a string. Declare the object differently, or avoid taking its address.can't take sizeof bit fieldIt is illegal to use sizeof to determine the size of a bit field member of a struct.cannot convert identifier* to a private base class identifier*C++. A pointer to a class X cannot convert to a pointer to a private base class Y unless the current function is a member or a friend of X.
class Y { }:
class X : Y;
void f(void)
{
class X *Px;
class Y *Py;
Py = (class Y *) Px;
cannot create instance of abstract class 'identifier'C++. An abstract class contains at least one pure virtual function by the declaration virtual func() = 0. It is illegal to declare objects of such a class. For example:
class abstract_class
{ public:
virtual int func() = 0;
int x, y;
};
class subclass : abstract_class
{ public:
virtual int func()
{ return (x* 2); }
int a, b;
};
void main()
{
subclass a; // OK
abstract_class b; // ERROR
// ...
}
cannot define parameter as externExtern is an illegal storage class for a function parameter.cannot delete pointer to constC++. It is illegal to use the delete operator on a const pointer. Remove the const casting, or remove the delete.See ARM 8.5.3 for more information. cannot find constructor for class matchingC++. The compiler cannot find a constructor that matches the current initializers. Use different initializers. Coerce some initializers so that they match those of a constructor, or define a new constructor. For example:
struct X
{ X(char *);
};
void main()
{
X a = 1L; // ERROR
X b = 3.1e20; // ERROR
X c = "hello"; // OK
}
cannot generate identifier for class 'identifier'C++. The compiler cannot define a copy constructor (X::X(X&)) for class X or an assignment operator (X& operator=(X&)) for class X for the class. If a class needs these methods, explicitly define them.The compiler cannot define an assignment operator if one of these conditions is true:
cannot generate template instance from -XI identifierC++. The compiler cannot generate a template instance from the specifier on the command line. Include the template definition in the program and correctly spell the template instance.cannot have member initializer for 'identifier'C++. The constructor initializer can initialize only nonstatic members. See ARM 8.12.6.2 for more information.cannot implicitly convertThis expression requires the compiler to perform an illegal implicit type conversion. To perform this conversion, explicitly cast the expression.cannot mix C++ EH with NT structured EHC++. You need to use one scheme or the other; you cannot mix them.cannot raise or lower access to base member 'identifier'C++. Access declarations in a derived class cannot grant or restrict access to an otherwise accessible member of a base class. For example:
class base
{ public:
int a;
private:
int b;
protected:
int c;
};
class sub : private base
{ public:
base::a; // OK
base::b; // ERROR: can't make b
// accessible
protected:
base::c; // OK
base::a; // ERROR: can't make a
}; // inaccessible
See ARM 11.3 for more information.
cannot throw object of 'identifier' not of ambient memory modelC++. You cannot throw near classes in large data models; likewise, you cannot throw far classes in small data models.case number was already usedThis value already occurs as a case within the switch statement.casts and sizeof are illegal in preprocessor expressionsAn extension to ANSI C allows the use of the sizeof operator and performs a cast in preprocessor directives. Turning on the Enforce ANSI Compatibility option in the IDDE (the -A command line option), disallows use of these expressions in a preprocessor directive.See ARM 15.3 for more information. catch type masked by previous catchC++. One of the following has occurred:
class name identifier expected after ~C++. A destructor is declared incorrectly. The proper name is class::~class(). If the class is named X, its destructor is X::~X().code segment too largeThe size of the code segment exceeds 64K bytes.comma not allowed in constant expressionIt is illegal to use a comma in a constant expression or to separate numbers by commas or spaces.See ANSI 3.4 for more information. comments do not nestWarning. Avoid nesting comments; it's easy to nest incorrectly and accidentally comment out the wrong code. Instead, use #if 0 and #endif to block out sections of code. Avoid crossing existing #if. For example, the following statements comment out the enclosed code:#if .... #endif compile all files with -EH to support exception handlingAll code that handles exceptions must be compiled with -EH.compile all files with -ER to support RTTITo support run-time type identification, compile all files in the project with -ER.const or reference 'identifier' needs initializerNonextern consts or references must be initialized.See ANSI 3.4 for more information. constant expression does not fit in switch typeThe value of a case is larger than the type of the switch expression. This error occurs, for example, if a 100000 was assigned to a short value.constant initializer expectedWhen initializing a variable being declared, any nonpointer type initializer must be either a constant or the address of a previously declared static or extern item. For example:const float pi = 3.1415; float a = 3.0; static float b; float w = a * 2; // ERROR: a isn't const float x = pi * pi; // OK: pi declared const float *y = &a; // ERROR: a isn't static float *z = &b; // OK: b is static 'continue' is valid only in a loopA continue statement occurs out of context. Use it only within for, while, and do/while statements.conversion of int to far or handle pointerIn this expression, the compiler needs to convert an integer to a far or handle pointer. This conversion probably means that a function that is not declared as a function returns a pointer. The compiler assumes the function returns an integer. For example:
float __far *f();
void main()
{
float __far *a, *b;
a = g(); // ERROR: g() not declared, so
// compiler assumes it returns
// int, not float *.
b = f(); // OK: f() declared as function
// returning float *
}
If the function is declared a function and the conversion is desired,
cast the integer to a long integer and then to a pointer, for example:
float far *ptr; int f(); ptr = f(); float far * // EROR ptr = () f(); // OK data or code defined in precompiled headerPrecompiled headers can contain only declarations, not definitions.declarator for 0 sized bit fieldA bit field must have a size.'default:' is already usedThe default: statement appears more than once in a switch statement.different configuration for precompiled headerThe precompiled header being used is precompiled with different options. Precompile the header again with the current options or check the current options for accuracy.divide by 0A constant expression tries to divide by zero or use modulo (%) of zero.duplicate direct base class 'identifier'C++. When declaring a new class, the same class occurs more than once in its list of direct base classes.See ARM 10.1 for more information. DS is not equal to DGROUPWarning. You have used the -W (Windows target) compiler option with the b modifier (assume DS != DGROUP), and a segment fixup was made to DGROUP.duplicate file names 'filename'While compiling files, the compiler tries to open the same list (.lst) or dump file (.dmp) in two places. It is illegal to refer to the same file in both the command line and source code. It is also illegal to use the same file for different outputs, such as .obj, .lst.empty declarationA declaration must declare at least a declarator, a tag, or the members of an enumeration.See ANSI 3.5 for more information. end of file found before '#endif'Missing #endif causes the compiler to reach the end of the file in the middle of a conditional compilation statement list.end of file found before end of comment, line numberA missing */ causes the compiler to reach the end of the file in the middle of a comment.end of line expectedUsing the Enforce ANSI Compatibility option in the IDDE (the -A command line option) does not allow any text to follow the #endif keyword, unless the text is a comment. For example:
#ifdef DEBUG
printf("oops\n");
#endif DEBUG // Not ANSI-compatible
#ifdef DEBUG
printf("oops\n");
#endif // DEBUG
// ANSI-compatible
error writing output fileThe compiler cannot write an output file, probably because the disk is full.exception specifications must match exactly for each declaration of a functionC++. For example:void func() throw(int); void func() throw(unsigned); // ERRORSee ARM 15.4 for more information. expected assembler directive PTR to follow assembler castInline Assembler. An assembler cast requires the word PTR. For example:
unsigned long 1;
asm {
mov AX,word PTR ;OK
mov AX, word 1 ;ERR
}
expected data def of 'identifier', not func defIt is illegal to declare nested functions in C or C++. For example:
void f()
{
void g() { } // ERROR: Nested
} // function.
exponent expectedThe compiler cannot find the exponent for the floating point number written. Do not put any white space between the e and the following exponent.expression expectedThe compiler expects to find an expression but cannot find one. A semicolon or a close brace may cause this problem.expression must be a pointerC++. The expression:dynamic_cast <type-name> (expression)must be a pointer. See ARM 5.2.6 for more information. expression must be a pointer or reference to a polymorphic typeC++. This message indicates an invalid use of dynamic_cast. (A polymorphic type is a class with at least one virtual function.)See ARM 5.2.6 for more information. external with block scope cannot have initializerIt is illegal to initialize a variable declared extern. Instead, initialize the variable in the file where it is defined.See ANSI 3.5.7 for more information. '_far16' is only valid in -mf memory modelThe _far16 type modifier is only valid when compiling for the OS/2 2.0 (Flat) memory model.'_far16' functions can only be externThe compiler cannot generate code for a _far16 function body; it can only call it.field 'identifier' must be of integral typeAn inappropriate type occurs for a member of a bit field structure. Use signed/unsigned char, short, int, or long.filespec string expectedThe compiler cannot find the filename string in an #include statement. Enclose the filename in double quotes or angle brackets.__finally or __except expectedC++. For Structured Exception Handling, __finally or __except must be part of the syntax for a __try block.forward referenced class 'identifier' cannot be a base classC++. A class must be declared before it can be used as a base class for a new class. A forward declaration is not sufficient. For example:
class A; // Forward reference for A
class B { // Declaration of B
int a, b, c;
void f();
};
class X : A { /*...*/ };// ERROR: A isn't
// declared
class Y : B { /*...*/ };// OK: B is
// declared
function 'identifier' can't be in an anonymous unionC++. An anonymous union cannot have function members.See ARM 9.6 for more information. function member 'identifier' has no prototypeThe compiler cannot find a function prototype for this function. The C++ compiler requires function prototypes by default. With C, this message occurs only when the -r option is selected.function 'identifier' is too complicated to inlineWarning. A function declared as inline is too complex to compile inline, so the compiler compiles it as a normal function.function definition must have explicit parameter listA function definition requires an explicit parameter list. It cannot inherit a parameter list from a typedef. For example, this definition does not compile:
typedef int functype(int q, int r);
functype funky // ERROR: No explicit
{ // parameter list
return q + r;
}
See ANSI 3.7.1 for more information.
function expectedThe compiler expects to find a function declaration but does not. Check for mismatched braces, parentheses not preceded by a function name, or a template declaration not followed by a class or function declaration.functions can't return arrays or functionsC. A function cannot return an array or a function. However, a function can return a pointer to an array or a pointer to a function. For example:typedef char ARRAY[256]; ARRAY func_returning_array(); // ERROR ARRAY *func_returning_ptr_to_array(); // OK GetExceptionCode() only valid in exception filter or handlerC++. GetExceptionCode() is part of Structured Exception Handling.GetExceptionInformation() only valid in exception filterC++. GetExceptionInformation() is part of Structured Exception Handling.global anonymous unions must be staticC++. Anonymous unions must be extern or static.See ARM 9.5 for more information. hex digit expectedThe compiler expects to find a hexadecimal digit after the characters 0x. Do not put any white space after the x.identifier expectedThe compiler expects to find an identifier, but finds instead another token.identifier found in abstract declaratorA type in a sizeof expression, typedef statement, or similar place incorrectly includes a variable name. For example:x = sizeof(int a[3]); // ERROR: a is a variable // name. x = sizeof(int[3]); // OK identifier is longer than 254 charsThe maximum size of an identifier is 254 characters.identifier or '(declarator) ' expectedThe compiler expects to find a declaration for a static variable, an external variable, or a function. If this error appears in a function, check to see if there are more left braces than right braces.illegal addressing modeInline Assembler. An illegal operand, such as [ah], appears.illegal castIt is illegal to cast an object to an inappropriate type. For example, structs or unions cannot cast to other types but can cast numerical values and pointers.illegal character, ascii number decimalThe source file includes a character, such as @ or $, that is not part of the C character set outside a comment or a string.illegal combination of typesCertain types cannot occur together. For example, you cannot:
illegal constuctor or destructor declarationC++. A constructor or destructor is incorrectly declared. For example, a constructor may be declared as virtual or friend, a destructor may be declared as friend, or a return value may be specified for a constructor or destructor.illegal operandInline Assembler. The inline assembler cannot evaluate an expression, such as when adding two vars:dec a + bInline assembler operands must be representable in one instruction. illegal operand typesThe operands are of the wrong type, casting the operands to a different type.illegal pointer arithmeticThe only legal operations on pointers are adding or subtracting an integer from a pointer; subtracting a pointer from another pointer; and comparing two pointers with <, >, ==, <=, or >=.illegal return type for operator->()C++. operator->() must return one of these:
illegal type combination, possible missing ';' after structYou may have omitted a semicolon (;) after a struct declaration.illegal type for 'identifier' memberVariables cannot be of type void.
struct X
{ void var; // ERROR
};
illegal type/size of operands for the identifier instructionInline Assembler Warning. An operand for an instruction is specified as the wrong size. This can be a warning or an error. The following example generates an error; it is illegal because the PUSH instruction does not allow for an 8-bit operand:char c; __asm push c;On the other hand, this is a warning: mov AX, cIt moves 16 bits from c. This can also happen for the following FPU instruction format, which is accepted by other compilers: fmul st(0)Rewrite it as: fmul st, st(0) implied return at closing '}' does not return valueWarning. A function is declared to return a value, but it returns without specifying one.initialization of 'identifier' is skippedA goto or case statement has resulted in an explicit or implicit initialization of a variable being skipped.See ARM 6.7 for more information. initializer for static member must be outside of class defC++. Static class members must initialize outside the class definition. For example:
class A
{ static int a = 5; // ERROR: Can't initialize static
// class var in class def.
void f();
};
class B
{ static int b;
void f();
};
int B::b = 6; // OK: Initialize static class var
// outside class def.
See ARM 9.4 for more information.
initializer or function body for dllimport not allowedFunctions or data objects you declare with the dllimport attribute must be extern declarations.integer constant expression expectedAn integer constant expression must occur in case statements; array size declarations; and the #if, #elif, #exit, and #line preprocessor commands.integral expression expectedAn integer type must occur in case statements; in array size declarations; and the #if, #elif, #exit, and #line preprocessor commands.internal error identifier numberA compiler error has occurred. Please report this error to Digital Mars.invalid instruction set 'set' for memory model 'model'You have specified a 16-bit instruction set for a 32-bit memory model.invalid reference initializationC++. It is illegal to use invalid reference initialization errors, which result from trying to initialize:
invalid storage class for friendC++. Friend functions cannot be virtual.keyword not supportedDigital Mars C/C++ recognizes but does not support the keyword. Use the int_xxx routines in the function library instead of the __interrupt keyword. This is the only instance of this message.last line in file had no \nCompiling with the Enforce ANSI Compatibility option in the IDDE (the -A command line option) on means that the last line of a source file must end with a newline character. A backslash cannot precede the newline.__leave must be within a __try blockC++. For Structured Exception Handling, __leave must be part of the syntax for a __try block.line number expectedThe line number in the #line directive must be a constant expression.linkage specs are "C", "C++", and "Pascal", not "identifier"C++. The compiler supports only the C++, C, and Pascal linkage types.local class cannot have static data member 'identifier'C++. A local class (that is, a class declared within a function) cannot have a static data member. For example:
void f()
{
class local_class
{ int a, b;
static int c; // ERROR: Can't have void g();
// static var in
} l1, l2; // local class
// ...
}
See ARM 9.4 for more information.
long long not supported for ANSI or 16 bit compiles64-bit ints are only supported for 32-bit memory models. The long long data type is not an ANSI standard data type.lvalue expectedThe compiler expects to assign a value to an expression, such as a variable. For example:
short short_f(void);
short *pshort_f(void);
void function(void)
{
short i;
short *p = &i; // Operand of ++ must be an lvalue
7++; // NO
short_f()++; // NO
pshort_f()++; // NO
// Left operand of an assignment
// must be an lvalue.
A, B = i; // NO
pshort_f() = i; // NO
*pshort_f() = i; // OK: Produces an lvalue
(*p)++; // OK
(*pshort_f())++; // OK
}
main(), WinMain(), or LibMain() cannot be static or inlineC++. It is illegal to declare any of the functions main(), WinMain(), or LibMain() as static or inline.See ARM 3.4 for more information. maximum width of number bits exceededThis field can contain number bits. For example:
struct X
{ char x:9; // ERROR: char is 8 bits
short y:17; // ERROR: short is 16 bits
long z:33; // ERROR: long is 32 bits
};
macro 'identifier' can't be #undef'd or #define'dIt is illegal to redefine or undefine this predefined macro. To suppress non-ANSI predefined macros, set the Suppress Predefined Macros option in the IDDE (the -u command line option).See ANSI 3.8.8 for more information. malformed template declarationC++. A template class or function is declared incorrectly. The following are correct declarations:
template<class T, int x> // OK
class vector
{
T v[x];
public:
vector();
T& operator[](int);
/* ... */
};
template<class T> // OK
T ave(T x, T y)
{
return ((T)((x + y) / 2));
}
See ARM 14 for more information.
maximum length of macro text exceededThe maximum length of a macro replacement text string has been exceeded.max of number characters in string exceededThis string can contain number characters.member 'identifier' can't be same type as struct 'identifier'A member of a structure with type identifier cannot itself have type identifier.member 'identifier' is const but there is no constructorC++. If a class has a const member, the class must also have a constructor. Initialize a const variable only in the constructor, for example:
class A
{ // ERROR: no constructor
const int x; // to initialize x
int y, z;
void f();
};
class B
{ const int x;
int y, z;
void f();
B(); // OK: x can be
}; // initialized.
member 'identifier' of class 'identifier' is not accessibleC++. A class member that is private or protected cannot be accessed.member 'identifier' of class 'identifier' is privateC++. Only a class function or a derived function of the class can use a private member. For example:
class super
{ private:
int x;
int f();
};
class sub : super
{
int g();
};
int super::f()
{
return (x++); // OK: B::f() is a
} // member function
int sub::g()
{
return (x++); // ERROR: sub::g() is a
} // member function
// of a derived class
void main()
{
super s;
s.x = 3; // ERROR: main() isn't a
return 0; // member function
} // or a friend
// function
missing ', ' between declaration of 'identifier' and 'identifier'You probably wrote something like:int x y;where x was to be a macro. missing decl-specifier-seq for declaration of 'identifier'You can only omit the decl-specifier-seq (the storage class followed by the declaration's type) in function definitions and function declarations.See ARM 7 for more information. must be void operator delete(void *[, size_t]);C++. The improper prototype occurs when the delete operator for a class that uses the C++ model is overloaded. The prototype for an operator delete overload must be either:void operator delete(void *); // OKor void operator delete(void *, size_t);// OK must use delete[] for arraysC++. To delete an array a, use this statement:delete[] a; // OKand not delete a; // ERRORSee ARM 5.3.4 for more information. need at least one external defThere must be at least one global symbol defined.See ANSI 3.7 for more information. no constructor allowed for class 'identifier'C++. The class includes a variable with the same name as the class. This prevents the use of a constructor that must have that name.no definition for static 'identifier'A static is referred to, but no definition is provided. For example:
static void f();
void g() { f(); }
See ANSI 3.7 for more information.
no identifier for declaratorAn identifier is missing from this declaration. For example:
void f(char [3]) // ERROR: No identifier
{
// ...
}
int [3]; // ERROR: No identifier
int a[3]; // OK: Identifier is a
no input file specifiedThis command line must include an input file.no instance of class 'identifier'C++. It is illegal to attempt the following:
struct CLASS
{
static void static_func();
void nonstatic_func();
static int static_data;
int nonstatic_data;
};
int CLASS::nonstatic_data = 1; // ERROR
int CLASS::static_data = 1; // OK
void main()
{
CLASS object;
int i = CLASS::nonstatic_data; // ERROR
int j = object.nonstatic_data; // OK
CLASS::nonstatic_func(); // ERROR
CLASS::static_func(); // OK
object.nonstatic_func(); // OK
}
no instance of class 'identifier' for member 'identifier'C++. You attempted to reference a member of a class without a this pointer being available.no match for function 'identifier'C++. The function is overloaded, and the compiler cannot find a function that matches the call.no return value for function 'identifier'A function has a return type other than void, but it has no return statement or has a path by which it doesn't return. For example:
int f()
{
if (x)
return;
}
See ARM 6.6.3 for more information.
no tag name for struct or enumWarning. If a struct or an enum does not have a tag name, further objects of this type cannot be declared later in the program. Give every struct and enum a tag name so that the compiler's type-safe linkage system can use it.non-const reference initialized to temporaryWarning. In most cases, this message means that a temporary occurs and the warning initializes the reference to that temporary. Since the reference is not const, the referenced temporary may change its value.However, this message becomes an error when the Enforce ANSI Compatibility option in the IDDE (the -A command line option) is set. See ARM 8.4.3 for more information. not a struct or union typeThe type of object preceding the object member operator selector (.) or the pointer to object selection (operator ->) is not a class, a struct, or a union.not an overloadable operator tokenC++. You cannot overload these operators:. .* :: ?: sizeof # ## not in a switch statementIt is illegal to use a case or default statement outside a switch statement.number 'number' is too largeThe number is too large to be represented in an object with long type.number is not representableThe compiler cannot represent a numeric constant because of the constraints listed in the following table:You cannot represent… If it is… Integer greater than ULONG_MAX (in limits.h) Floating point number less than DBL_MIN or greater than DBL_MAX (in float.h) Enumeration constant greater than INT_MAX (in limits.h) Octal character constant greater than 255 object has 0 sizeThe compiler does not allow objects of zero size. Trying to subtract two pointers that point to zero size objects causes division by zero.octal digit expectedThe compiler expects that a number with a leading 0 is an octal digit. Using an 8 or 9 is illegal.one argument req'd for member initializer for 'identifier'C++. Member initializers in which the member lacks a constructor must have exactly one parameter because the member is initialized by assignment.only classes and functions can be friendsC++. It is legal to declare other classes or functions friend only when declaring a function within a class.only one identifier is allowed to appear in a declaration appearing in a conditional expressionC++. Pointers and references to references are invalid. operator functions ->() and [] must be non-static members C++. It is illegal to declare as static these operators:
operator overload must be a functionC++. It is illegal to declare an overloadable operator as a variable. For example:
struct X
{ int operator<<; // ERROR
};
out of memoryThe compiler is out of memory. Try the following:
overloaded function 'identifier' has different access levelsC++. It is illegal to adjust the access of an overloaded function that has different access levels. For example:
class base
{
public:
void f(int);
private:
void f(float);
};
class sub : base
{ base::f; // ERROR: f() is
}; // overloaded.
See ARM 11.3 for more information.
parameter list is out of contextParameters in a function definition are illegal and are discarded. For example:int f(a, b); // ERROR int g(int, int); // OK int h(int a, int b); // OK parameter lists do not match for template 'identifier'C++. The parameter list for the template instantiation does not match the formal parameter list for the class definition.
template<class T, int size> class vector;
template< class T, unsigned size> class
vector; // no {}
vector<int, 20> x; // OK
vector<float, 3.0> // ERROR: 3.0 is not an int.
pascal string length number is longer than 255This __pascal string's length exceeds 255 characters.pointer required before '->', '->*' or after '*'C++. These operators can apply only to pointers. The operators -> and ->* must precede the pointer, and the operator * must follow it.pointer required before '->' or after '*'C. These operators can apply to pointers only. The operator ->must precede the pointer, and the operator * must follow it.pointer to member expected to right of .* or ->*C++. The identifier after . or ->* must be a pointer to a member of a class or struct.possible extraneous ';'Warning. The compiler finds a semicolon immediately after an if, switch, or while statement and executes the next statement, regardless of whether the test evaluates to true or false. For example:
int x = 1, y = 0;
if (x== y); // WARNING: Extra
printf("x == y\n"); // semicolon.
printf(); // always executed.
if (x == y) // OK
printf("x == y\n");
If a semicolon is desired, suppress the warning by putting white
space, such as a space or a return, between the close parenthesis
and the semicolon.
while (fread(file) == unwanted_data) ; // OK: semicolon is intentional possible unintended assignmentWarning. The assignment operator (=) instead of the equality operator (==) appears in the test condition of an if or while statement. For example:
if (x = y) {...} // WARNING: x= y is an assignment
instead of
if (x == y) {...} // OK: x == y is a test
Test the value of the assignment explicitly, like this:
if ((x = y) != 0) {...} // OK: (x = y) != 0 is a test
The compiler produces identical code for the first and third
examples.
pragma cseg must be at global scopeA #pragma cseg statement must occur in the global scope and not within a function body or type definition.precompiled header compiled with C instead of C++C++. You have included a C precompiled header in a C++ compilation.precompiled header compiled with C++ instead of CC. You have included a C++ precompiled header in a C compilation.prefix opcode must be followed by an assembler opcodeThe opcode must immediately follow the LOCK, REP, REPE, REPNE, or REPZ instruction prefixes.premature end of source fileA string that is missing a closing quote or a comment that is missing a */ causes the compiler to reach the end of the file while processing a function.prototype for 'identifier' should be identifierA function of the form: func(s) short s; { ... } should be prototyped as:func(int s);rather than: func(short s);See ANSI 3.5.4.3 for more information. pure function must be virtualC++. Pure member functions must be declared as virtual, like this:
class B
{ virtual void f() = 0; // OK
void g() = 0; // ERROR
};
qualifier or type in access declarationC++. It is illegal to specify a storage class or type when adjusting the access to a member of a base class. For example:
class base
{ public:
int b, c, d;
int bf();
};
class sub : private base
{ int e;
public:
base::b; // OK
int base::c; // ERROR
static base::d; // ERROR
};
See ARM 11.3 for more information.
recursive prototype, turn off autoprototypingUse the -p compiler option (see Compiling Code) to turn off autoprototyping.redefinition of default parameterC++. It is illegal to redefine the default argument for a parameter even if redefined to the same value. For example:
// Prototyping the function.
int f(int, int = 0);
// Defining the function.
int f(int a, int b = 0) // ERROR: Can't
{ // redefine default
return g(a, b); // argument, even to
} // the same value.
The line given for the error is sometimes past the closing brace of
the body of the function.
reference to 'identifier' caused a 386 instruction to be generatedInline Assembler Warning. This warning occurs when not using 32- bit compilation when a reference to a variable causes a 32-bit mode instruction to generate, such as:
unsigned long UL;
ASM {
INC UL // incrementing a long is 32 bit
}
reference must refer to same type or be constWhen initializing a reference, the object being used as an initializer must be of the same type as the reference, or it must have const type.return type cannot be specified for conversion functionC++. It is illegal to specify the return type of a conversion function. For example:
class X
{ char* operator char* (); // ERROR
operator char* (); // OK
};
See ARM 12.3.2 for more information.
returning address of automatic 'identifier'Warning. This results in an invalid pointer beyond the end of the stack. When the function returns, the caller receives an illegal address that can cause a general protection fault.segment size is number, exceeding 64KBCode and data for 16-bit compilations are output into 64KB segments, one of which exceeds 64KB. This can happen when declaring objects whose combination is larger than 64KB. For example: int a[50000]. Divide the source module into smaller pieces, or switch to a 32-bit memory model.should be number parameter(s) for operatorC++. The incorrect number of arguments appears in a declaration of an overloaded operator. The function call operator () is n-ary; it can take any number of arguments.size of identifier is not knownIt is illegal to use a struct or an array with an undefined size. For example:
struct x
{ int a[]; // ERROR
/* ... */
};
struct y
{ int a[100]; // OK
/* ... */
};
size of type exceeds 64KBData objects in 16-bit memory models cannot exceed 64KB unless declared with the _huge modifier.statement expectedThe compiler expects a statement but does not encounter one. A missing comma or semicolon or a label without a statement can cause this error. For example:
while (TRUE)
{ // ...
if (done)
goto end1;
// ...
end1:
} // ERROR: No statement after
// label.
while (TRUE)
{ // ...
if (done)
goto end2;
// ...
end2: ; // OK: Null statement after label.
}
static function 'identifier' can't be virtualYou cannot mix static and virtual storage classes for member functions. (Note that the operators new() and delete() are static.)static or non-member functions can't be const or volatileC++. It is illegal to declare a static class member function or a nonmember class function as const or volatile.static variables in inline functions not allowedC++. It is illegal to declare a static variable within an inline function.storage class for 'identifier' can't be both extern and inlineC++. It is illegal to use the inline type specifier for a function declared external.string expectedThe compiler expects to encounter a string but cannot find one. Check for an #ident directive not followed by a string.struct-declaration-list can't be emptyC. A struct must contain at least one member.See ANSI 3.5.2.1 for more information. template-argument 'identifier' must be a type-argumentC++. In a function template, all template arguments must be type arguments. Unlike class templates, function templates cannot have expression arguments. For example:
template <class T, int x> foo(T y)
// ERROR: x is an expression argument.
{ return x + y;
}
See ARM 14.4 for more information.
template-argument 'identifier' not used in function parameter typesC++. When defining a template, every template argument in the template's argument list must appear in the function's argument list. For example:
template <class T1, class T2>
int bar(T1 x) // ERROR: T2 isn't in
{ // function's
T2 y; // argument list.
// ...
}
See ARM 14.4 for more information.
too many errorsThe compiler has reached its limit of four errors. For the compiler to continue past its limit, set the Turn Off Error Maximum option in the Compiler Output dialog box in the IDDE (the -x command line option).too many initializersThe item contains too many initializers. For example:char a[3]="hello"; // ERROR char b[3]="hi!"; // ERROR: No room for // null character char c[3]="hi"; // OK trailing parameters must have initializersC++. Parameters with default initializers must occur at the end of a parameter list. For example:int f(int, int= 1, int = 0); // OK int g(int = 0, int = 1, int); // ERROR int h(int = 0, int, int = 1); // ERROR __try only valid for -mn memory modelCode that uses the __try modifier must be compiled for the Windows NT memory model.type conversions must be membersC++. It is illegal to declare a type conversion function outside a class. Declare it inside a class.type is too complexC++. The compiler appends information regarding parameter and return types to the end of a function name. With this information added, the identifier exceeds the compiler's maximum of 254 characters.type mismatchThis error is either a syntax error or a warning message. The compiler expects to find one data type but finds another. More information about which types it expects and what it finds follows this message.type must be a pointer or a reference to a defined class or void*This message refers to the type specified in a dynamic_cast.type must be void *operator new(size_t [,..]);C++. The wrong prototype appears when the new operator for a class that uses the C++ model is overloaded. When operator new is overloaded, it must have a return type of void * and take a first argument of size_t. The compiler automatically sets the value of the first argument to be the class size in bytes.See ARM 5.2.6 for more information. type of 'identifier' does not match function prototypeThe arguments of the function do not match the prototype previously given.types may not appear more than once in an exception specificationIt is illegal to write an exception specification like:void func() throw(int, int);See ARM 15.4 for more information. unable to open input file 'filename'The compiler cannot find the file. Correctly spell the name and specify the correct folder.unable to open output file 'filename'The compiler cannot open the file. Specify a valid file name and make sure there is enough disk space.undefined escape sequenceThe compiler recognizes only the following escape sequences in a string or character constant:undefined identifier 'identifier'It is illegal to use an identifier without declaring it. Correctly spell the identifier.undefined label 'identifier'The goto command to go to a label must be defined. Correctly spell the label and make sure the label appears in the same function as the goto.undefined tag 'identifier'The structure or union is not defined.undefined use of struct or unionIt is illegal to use operators, such as arithmetic or comparison operators, that do not apply to structs, classes, or unions.Table 29-1 Defined escape sequences This sequence… Represents… \' single quote \" double quote \? question mark \\ backslash \a alert (bell) \b backspace \f form feed \n newline \r return \t tab \v vertical tab \xXXX the character specified with the hexadecimal number \000 the character with the octal number unknown operand type for this floating point instructionInline Assembler. It is illegal to enter an inappropriate operand, such as a numeric constant, on a floating point instruction. For example:fdiv 0x50 union members cannot have ctors or dtorsC++. A union cannot contain a member that is an object of a class with a constructor or a destructor.unrecognized pragmaWarning. The compiler does not recognize this #pragma directive. See Digital Mars C++ Language Implementation for a list of valid pragmas.unrecognized parameter 'identifier'The compiler does not recognize a parameter or option on the command line. Command line options are case sensitive.unrecognized preprocessing directive '#identifier'The compiler does not support the specified preprocessor directive.unrecognized tokenThe compiler does not recognize the token as valid. Check for an extra U or L suffix in an integer constant. It is illegal to use $ and @ in identifiers.unsupported based typeC++. Valid based types are:
__based(__segname("_DATA")) => __near
__based(__segname("_STACK")) => __ss
__based(__segname("_CODE")) => __cs
unsupported __declspec typeSupported __declspec types are:declspec(dllimport) declspec(dllexport) declspec(naked) declspec(thread) unterminated macro argumentA macro argument is missing a close quote or parenthesis.unterminated stringA string is missing a close quote, or a file contains a lone quote mark. The compiler found end of line or end of file before the string terminator.See ANSI 3.1.3.4 for more information. use delete[] rather than delete[expr], expr ignoredWarning. C++. This syntax for deleting an array of objects is outdated, although the current version of the compiler supports it and ignores expr:delete [expr] p; // WARNING: obsoleteNew code uses this syntax instead: delete [] p; // OK using operator++() (or --) instead of missing operator++(int)Warning. C++. It is illegal to use the postfix increment (or decrement) operator on an object of a class, such as x++, without overloading the postfix operator for that class. However, the prefix operator is overloaded. The compiler uses the prefix version of the operator.To overload the postfix increment operator x++, use operator++(). To overload the prefix increment operator ++ x, use operator++(int). valid memory models are -m[tsmcrzlvfnpx]This command line error indicates that the options for memory model selection are incorrect.value of expression is not usedWarning. It is illegal to compute an expression without using its value, such as the equality operator (==) instead of the assignment operator (=). For example:x == y; // WARNING: The value of x // doesn't change. x = y; // OK: x and y have same value.Failure to assign the result of a computation to a variable can also cause this error. For example: t - 5; // WARNING: Result of this // computation is lost. x = t - 5; // OK: x contains the result. t -= 5; // OK: t contains the result. variable 'identifier' used before setWarning. The optimizer discovers that a specified variable appears before it is initialized. The program may generate inexplicable results.vectors cannot have initializersC++. It is illegal to initialize a vector of objects with a constructor that has an argument list.very large automaticWarning. Large automatic variables can cause stack overflow. Dynamically allocate the memory with a function such as malloc().voids have no valueC. It is illegal to return a value from a function declared void or to use the value of a function declared void.voids have no value, ctors and dtors have no return valueC++. It is illegal to return a value from a constructor, destructor, or function declared void or a reference to a void. It is also illegal to use the value of a constructor, destructor, or function declared void.'while' expectedThe keyword while is missing from the end of a do/while loop. For example:
do
{
x = f(y);
} (x != 0); // ERROR: missing while.
do
{
x = f(y);
} while (x != 0); // OK
|