Turbo C++ Error Messages (V2.0)
/
--------------------------------------------------------------------------------
In the error messages listed in this appendix, words enclosed in single quotes represent a generic name or value. The error message the user sees on the screen is the message after that word has been replaced with a specific name or value. For example: if a C++ function goforit has an error, the actual message the user sees on the screen is:
goforit must be declared with no arguments
To look up this message, you must find the following entry:
function must be declared with no arguments
Below are the generic names and values enclosed in quotes used in the error messages in this appendix. The error message the user gets should first be replaced with the corresponding name or value, and then looked up.
Seen in the manual Seen on the screen
argument a command line or other argument
class a class name
field a field reference
filename a file name (with or without extension)
group a group name
identifier an identifier (variable name or other)
Language the name of a programming language
member the name of a data member or member function
message a message string
module a module name
number an actual number
option a command line or other option
parameter a parameter name
segment a segment name
specifier a type specifier
symbol a symbol
xxxxh a 4-digit hexadecimal number followed by h
This appendix lists the error messages in ASCII alphabetical order. Messages beginning with symbols (equal sign, comma, parentheses, etc.) are usually placed first. Since the error messages beginning with the variables listed in the above table cannot be arranged in the alphabetical order of the actual message seen on the screen, all such messages are always placed at the beginning of each error message table.
If the variable appears later in the body of the error message, for example:
Incorrect command__Lineargument
then it can be looked up in alphabetical order under this error message; here it can be found among the messages beginning with “I”.
I. Runtime errors
Turbo C++ has only a small number of runtime error messages. They are listed below in alphabetical order.
●Abnormal program terminationThe program terminated abnormally. This is caused by insufficient memory found while the program is running. In addition, calling the function abort will display this message. Some runtime errors will call the abort function at the end, so this message will be displayed.
●Divide by 0
Integer division by 0. This error can be detected by the signal function. In addition, the abort function will also be called, causing the program to terminate abnormally.
●Floating point error: Divide by 0
The divisor is 0. For example, 1.0/0.0.
●Floating point error: Domain
The result is not a number. For example, 0.0/0.0.
●Floating point error: Overflow
The result is +∞ or -∞ with complete loss of precision. For example:
double x=le200*le200
●Floating point error: Partial loss of precision
Precision was lost during a floating-point operation. By default this error is masked; you can call control87 to remove the mask.
●Floating point error:Underflow
Underflow occurred during a floating-point operation, and the underflow value was replaced with 0.0. By default this error is masked; you can call control87 to remove the mask.
●Floating point error: Stack fault
A floating-point operation caused stack overflow. This error does not occur often; it may be due to too many registers being used in assembly code, or because a floating-point function was not declared.
Note: all of the floating-point errors above can be masked with the function control 187, and can also be caught with the function signal. In addition, these floating-point errors will also call the function abort, to print: Abnormal program termination, and call exit(3).
●Null pointer assignment
When a small or medium memory model program exits, the contents of several bytes at the beginning of the program data segment are checked to see whether they have changed. If these bytes have been changed, this message is displayed. Usually this is because a value was stored into an uninitialized pointer. Even if the program producing this error appears to run normally in other respects, it reflects a serious internal error and should be taken seriously. Indirect assignment through an uninitialized pointer may lead to unpredictable consequences (in large, compact, or huge memory models, “deadlock” may also occur). In the integrated debugger you can trace the null pointer.
●Stack overflow
The default stack size in a Turbo C++ program is 4096 bytes. This is enough for most programs, but stack overflow may occur when the program performs complex recursion or uses a large amount of local data. This message can be obtained only when the stack-checking feature is turned on. To correct this error, you can try using a larger memory model, or increase the stack size by changing the value of the global variable stklen, or reduce the program's use of the stack. To reduce the amount of local data in a function, you can declare it as a static variable (static). For example:
void anyfunction(void)
{
static int buf[2000]; /*allocated in the data segment*/
int list [2000]; /*allocated on the stack*/
Declaring local variables as static has two disadvantages:
1. It permanently occupies space outside the global variables and stack, though this is only a minor disadvantage. 2. If variables in a function are declared static, then that function cannot be called recursively or asynchronously. Because for variables declared as Static, each call to the function uses the same space rather than separate space.
II. Compile errors
Diagnostic messages produced by the Turbo C++ compiler (TC or TCC) are divided into three kinds: fatal errors, errors, and warnings.
●Fatal errors: cause the compilation process to stop immediately. Appropriate corrective action should be taken, and then recompilation should be done.
●Errors: indicate program syntax errors, disk or memory access errors, and command line errors. The compiler will complete the current compilation phase and then stop. Also, at each compilation phase (preprocessing, parsing, optimization, and code generation), the compiler will find as many real errors in the source program as possible.
●Warnings: do not terminate the compilation process. They indicate questionable conditions that are legal as part of the language. When machine-dependent constructs are used, the compiler always generates warning messages.
The compiler displays messages in the following format: first the message type, then the file name and line number, and finally the message text. In each category below, they are listed in alphabetical order.
1. Fatal errors
●Bad call of inline function
An inline function defined using a macro definition (a predefined macro) was not called in the correct way. In C, predefined inline functions begin and end with double underscores (__).
●Irreducible expression tree
An expression on the error line caused the code generator to be unable to generate code. This is an internal compiler error, and that expression will not be translated. If this error ever occurs, notify Borland.
●Out of memory
Out of memory during compilation. Either increase machine memory, or if your machine already has 640K of memory, simplify the source file.
●Register allocation failure
An expression on the error line is too complex for the code generator to generate code for it. This is also an internal compiler error. Simplify the expression. If this error occurs, notify Borland.
2. Errors
●constructorcannot return a value
A return statement in a C++ constructor cannot have an expression as a return value.
●constructoris not a base class of class
A constructor constructor of a C++ class class tried to call a base-class constructor, or you tried to change the access permission of class::constructor. constructor is not a base class of class. Check your declaration.
●functionlcannot be distinguished from function2
The difference between the parameter type lists in the declarations of function1 and function2 is not enough to distinguish them. You can try changing the parameter type or parameter order in one of the functions.
●functionis ambiguous
In a function call, more than one overloaded function parameter list can match the argument list of the call (using the default parameter conversion rules). One or more arguments should be explicitly type-converted to resolve this ambiguity.
●functionmust be declared with no argumentsThis C++ operator function cannot have any arguments.
●functionmust be declared with one argumentThis C++ operator function can only have one argument.
●functionmust be declared with two argumentsThis C++ operator function must have two arguments.
●functionwas previously declared without staticThis function is declared here as static, but earlier it was already declared as external (extern) or global. ANSI C does not allow this.
●functionwsa previously declared with the language languageThis function was declared in different places with different language modifiers (cdecl, pascal, or interrupt), which is an error.
●identifier cannot be declared in an anonymous unionAn anonymous union cannot contain member functions or static members. Anonymous unions can contain only data members.
●identifier cannot be used in static member function
A static member function can use only static members in its class, even though it has full access privilege. This error is caused by trying to use a member that requires the this pointer.
●identifieris inaccessible because also in class
It is illegal to use a class as both a direct base class and an indirect base class. You can declare the base class virtual in both places.
●identifier is not a data member and cant be initialized here
In a constructor, only data members can be initialized. This message indicates that the initializer list contains a static member or function member.
●identifieris not a member of struct
identifier is being referenced as a structure member, but it is not a structure member. Check your declaration.
●identifieris not a parameter
In the parameter declaration part of an old-style function definition, idenitfier is declared, but it is not listed as a parameter. You can remove this declaration or make identifier a parameter.
●identifieris not legal here
The type specifier identifier conflicts with or duplicates another type name, or it is being used as a typedef name when in this scope it is not a typedef name.
●identifieris virtual and cannot be explicitly initialized
A constructor of a C++ class tried to call the base-class constructor identifier, but that base class is a virtual base class. A virtual base class cannot be explicitly initialized; the compiler will automatically make an implicit call to the base class default constructor base::base().
●identifiermust be a member function
Most C++ operator functions can be either class members or ordinary non-member functions, but some can only be member functions of a class. These are operator=, operator→, operator(), and type conversions.
●identifiermust be a member function or have an argument of class type
Most operator functions must have an explicit or implicit argument of class type. This operator function is declared outside a class and has no explicit class-type argument.
/
--------------------------------------------------------------------------------
In the error messages listed in this appendix, words enclosed in single quotes represent a generic name or value. The error message the user sees on the screen is the message after that word has been replaced with a specific name or value. For example: if a C++ function goforit has an error, the actual message the user sees on the screen is:
goforit must be declared with no arguments
To look up this message, you must find the following entry:
function must be declared with no arguments
Below are the generic names and values enclosed in quotes used in the error messages in this appendix. The error message the user gets should first be replaced with the corresponding name or value, and then looked up.
Seen in the manual Seen on the screen
argument a command line or other argument
class a class name
field a field reference
filename a file name (with or without extension)
group a group name
identifier an identifier (variable name or other)
Language the name of a programming language
member the name of a data member or member function
message a message string
module a module name
number an actual number
option a command line or other option
parameter a parameter name
segment a segment name
specifier a type specifier
symbol a symbol
xxxxh a 4-digit hexadecimal number followed by h
This appendix lists the error messages in ASCII alphabetical order. Messages beginning with symbols (equal sign, comma, parentheses, etc.) are usually placed first. Since the error messages beginning with the variables listed in the above table cannot be arranged in the alphabetical order of the actual message seen on the screen, all such messages are always placed at the beginning of each error message table.
If the variable appears later in the body of the error message, for example:
Incorrect command__Lineargument
then it can be looked up in alphabetical order under this error message; here it can be found among the messages beginning with “I”.
I. Runtime errors
Turbo C++ has only a small number of runtime error messages. They are listed below in alphabetical order.
●Abnormal program terminationThe program terminated abnormally. This is caused by insufficient memory found while the program is running. In addition, calling the function abort will display this message. Some runtime errors will call the abort function at the end, so this message will be displayed.
●Divide by 0
Integer division by 0. This error can be detected by the signal function. In addition, the abort function will also be called, causing the program to terminate abnormally.
●Floating point error: Divide by 0
The divisor is 0. For example, 1.0/0.0.
●Floating point error: Domain
The result is not a number. For example, 0.0/0.0.
●Floating point error: Overflow
The result is +∞ or -∞ with complete loss of precision. For example:
double x=le200*le200
●Floating point error: Partial loss of precision
Precision was lost during a floating-point operation. By default this error is masked; you can call control87 to remove the mask.
●Floating point error:Underflow
Underflow occurred during a floating-point operation, and the underflow value was replaced with 0.0. By default this error is masked; you can call control87 to remove the mask.
●Floating point error: Stack fault
A floating-point operation caused stack overflow. This error does not occur often; it may be due to too many registers being used in assembly code, or because a floating-point function was not declared.
Note: all of the floating-point errors above can be masked with the function control 187, and can also be caught with the function signal. In addition, these floating-point errors will also call the function abort, to print: Abnormal program termination, and call exit(3).
●Null pointer assignment
When a small or medium memory model program exits, the contents of several bytes at the beginning of the program data segment are checked to see whether they have changed. If these bytes have been changed, this message is displayed. Usually this is because a value was stored into an uninitialized pointer. Even if the program producing this error appears to run normally in other respects, it reflects a serious internal error and should be taken seriously. Indirect assignment through an uninitialized pointer may lead to unpredictable consequences (in large, compact, or huge memory models, “deadlock” may also occur). In the integrated debugger you can trace the null pointer.
●Stack overflow
The default stack size in a Turbo C++ program is 4096 bytes. This is enough for most programs, but stack overflow may occur when the program performs complex recursion or uses a large amount of local data. This message can be obtained only when the stack-checking feature is turned on. To correct this error, you can try using a larger memory model, or increase the stack size by changing the value of the global variable stklen, or reduce the program's use of the stack. To reduce the amount of local data in a function, you can declare it as a static variable (static). For example:
void anyfunction(void)
{
static int buf[2000]; /*allocated in the data segment*/
int list [2000]; /*allocated on the stack*/
Declaring local variables as static has two disadvantages:
1. It permanently occupies space outside the global variables and stack, though this is only a minor disadvantage. 2. If variables in a function are declared static, then that function cannot be called recursively or asynchronously. Because for variables declared as Static, each call to the function uses the same space rather than separate space.
II. Compile errors
Diagnostic messages produced by the Turbo C++ compiler (TC or TCC) are divided into three kinds: fatal errors, errors, and warnings.
●Fatal errors: cause the compilation process to stop immediately. Appropriate corrective action should be taken, and then recompilation should be done.
●Errors: indicate program syntax errors, disk or memory access errors, and command line errors. The compiler will complete the current compilation phase and then stop. Also, at each compilation phase (preprocessing, parsing, optimization, and code generation), the compiler will find as many real errors in the source program as possible.
●Warnings: do not terminate the compilation process. They indicate questionable conditions that are legal as part of the language. When machine-dependent constructs are used, the compiler always generates warning messages.
The compiler displays messages in the following format: first the message type, then the file name and line number, and finally the message text. In each category below, they are listed in alphabetical order.
1. Fatal errors
●Bad call of inline function
An inline function defined using a macro definition (a predefined macro) was not called in the correct way. In C, predefined inline functions begin and end with double underscores (__).
●Irreducible expression tree
An expression on the error line caused the code generator to be unable to generate code. This is an internal compiler error, and that expression will not be translated. If this error ever occurs, notify Borland.
●Out of memory
Out of memory during compilation. Either increase machine memory, or if your machine already has 640K of memory, simplify the source file.
●Register allocation failure
An expression on the error line is too complex for the code generator to generate code for it. This is also an internal compiler error. Simplify the expression. If this error occurs, notify Borland.
2. Errors
●constructorcannot return a value
A return statement in a C++ constructor cannot have an expression as a return value.
●constructoris not a base class of class
A constructor constructor of a C++ class class tried to call a base-class constructor, or you tried to change the access permission of class::constructor. constructor is not a base class of class. Check your declaration.
●functionlcannot be distinguished from function2
The difference between the parameter type lists in the declarations of function1 and function2 is not enough to distinguish them. You can try changing the parameter type or parameter order in one of the functions.
●functionis ambiguous
In a function call, more than one overloaded function parameter list can match the argument list of the call (using the default parameter conversion rules). One or more arguments should be explicitly type-converted to resolve this ambiguity.
●functionmust be declared with no argumentsThis C++ operator function cannot have any arguments.
●functionmust be declared with one argumentThis C++ operator function can only have one argument.
●functionmust be declared with two argumentsThis C++ operator function must have two arguments.
●functionwas previously declared without staticThis function is declared here as static, but earlier it was already declared as external (extern) or global. ANSI C does not allow this.
●functionwsa previously declared with the language languageThis function was declared in different places with different language modifiers (cdecl, pascal, or interrupt), which is an error.
●identifier cannot be declared in an anonymous unionAn anonymous union cannot contain member functions or static members. Anonymous unions can contain only data members.
●identifier cannot be used in static member function
A static member function can use only static members in its class, even though it has full access privilege. This error is caused by trying to use a member that requires the this pointer.
●identifieris inaccessible because also in class
It is illegal to use a class as both a direct base class and an indirect base class. You can declare the base class virtual in both places.
●identifier is not a data member and cant be initialized here
In a constructor, only data members can be initialized. This message indicates that the initializer list contains a static member or function member.
●identifieris not a member of struct
identifier is being referenced as a structure member, but it is not a structure member. Check your declaration.
●identifieris not a parameter
In the parameter declaration part of an old-style function definition, idenitfier is declared, but it is not listed as a parameter. You can remove this declaration or make identifier a parameter.
●identifieris not legal here
The type specifier identifier conflicts with or duplicates another type name, or it is being used as a typedef name when in this scope it is not a typedef name.
●identifieris virtual and cannot be explicitly initialized
A constructor of a C++ class tried to call the base-class constructor identifier, but that base class is a virtual base class. A virtual base class cannot be explicitly initialized; the compiler will automatically make an implicit call to the base class default constructor base::base().
●identifiermust be a member function
Most C++ operator functions can be either class members or ordinary non-member functions, but some can only be member functions of a class. These are operator=, operator→, operator(), and type conversions.
●identifiermust be a member function or have an argument of class type
Most operator functions must have an explicit or implicit argument of class type. This operator function is declared outside a class and has no explicit class-type argument.
ko20010214
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器

.
is needed so that the array elements can be constructed. This constructor has only one parameter (a reference to its class) and is called a reference constructor.
perator=(class&) to copy a vector
i,10) {…}