No access specifier has been provided for a base class. A base class can be declared with the access specifier "public" or "private". The C++ language specification requires that "private" becomes the default when no access specifier is present. It is good coding practice to explicitly provide the access specifier for the base class.
Recovery
Provide an access specifier or accept the default.
The specified symbol has been declared within a function but it has not been set or used. This is only an informational message because you can declare symbols that are not unused, but it is probably undesirable.
Recovery
Ignore the message, use the symbol, or remove the symbol.
The compiler was not able to find a single type common to the two specified types and was therefore unable to convert from one to the other.
Recovery
Explicitly cast the type to an intermediate type and then convert to requested type.
The specified statement was found outside the valid scope for such a statement. This typically means that it is outside any function.
Recovery
Place the statement in the correct scope or remove it.
Only one "default" label is allowed in a "switch" statement. This "default" label is not the first in the switch statement.
Recovery
If you have nested switch statements, check that the braces match correctly. If they do not match, remove one of the "default" labels.
The specified label has already been defined in the current function. A label can only be declared once within a function.
Recovery
Remove or rename one of the label definitions.
The compiler generates information for the class browser. Using the "#line" preprocessor directive may cause that information to be corrupted.
Recovery
Remove the "#line" macro directive or note the possible corruption.
The compiler could not open the specified source file.
Recovery
Ensure the source file name is correct. Ensure that the correct file is being read and has not been corrupted. If the file is located on a LAN drive, ensure the LAN is working properly. Also, the file may be locked by another process or access may be denied because of insufficient permission.
The compiler detected an error while reading from the specified file.
Recovery
Ensure the correct file is being read. If the file resides on a LAN drive, ensure that the LAN is working correctly.
The name of the source file to be compiled was missing from the compiler invocation.
Recovery
Ensure that you specify the source file name. Ensure the compiler options are specified correctly as well; the compiler may misinterpret the command line if the options are specified incorrectly.
The end of the source file was reached and the comment or block was not closed. It is also possible that there was a typographical error earlier in the source file.
Recovery
Check the source file for typographical errors. End the comment or block before the end of the file.
A function with a return type of "void" cannot return a value.
Recovery
Remove the value or expression from the return statement, remove the return statement, or change the return type of the function.
The specified identifier is used but has not been defined.
Recovery
Define the identifier before using it. Check its spelling. If the identifier has been defined in a header file, check that any required macros have been defined.
The specified macro was defined with a different number of arguments than are used in this macro call.
Recovery
Ensure that the macro call corresponds to the macro definition. Check the number and levels of corresponding braces in the macro.
Recovery
Ensure the output file name is correct. Also, ensure that the location of the output file has sufficient storage available. If using a LAN drive, ensure that the LAN is working properly and you have permission to write to the disk.
The specified member is private, protected, or is a member of a private base class and cannot be accessed from the current scope.
Recovery
Check the access specification rules for the member function and change the access specifier if necessary. If the member function belongs to a base class, check the access specifier of the base class where the current class is defined.
No value is returned from the current function, but the function is expecting a non-void return value. The function was declared with a return type but the compiler did not detect a return statement. Only functions with a void return type may have no return statement or have a return statement with no return value.
Recovery
Return a value from the function or change the functions's return type to void.
An attempt is made to give private access to a base class member or to give an access that is different from the access the member was declared with. A derived class can only change the access of a base class member to public or protected if the access of that member was not private in the base class.
Recovery
Remove the invalid access statement or change the access specifier in the base class.
The expression in a "case" statement must be an integral constant expression followed by a colon ( :). A constant expression has a value that can be determined during compilation and does not change during execution.
Recovery
Use an integral constant expression.
The compiler does not emit executable code from inlined assembly language instructions.
Recovery
Ignore the message or replace the assembly code with C++.
The compiler detected a preprocessor directive at the beginning of this line, then found an error in the directive. The rest of the line in the preprocessor directive is ignored.
Recovery
Remove the unexpected token so that only the preprocessor directive appears on the line.
The declaration conflicts with a previous declaration of the same name.
Recovery
Change one of the names or eliminate one of the declarations.
An attempt is being made to define a name that has already been defined.
Recovery
Change one of the names or remove one of the definitions. Check the spelling and the scope of the two variables.
A declaration of a member function outside its member list must be a function definition. Once you declare a member function inside a class declaration, you cannot redeclare it outside the class.
Recovery
Either remove the member function declaration outside the member list or change it to a definition.
These two attributes cannot both be specified in the same declaration.
Recovery
Remove one of the specified attributes.
The specified keyword is not allowed in this context.
Recovery
Remove the keyword.
The compiler identified a # character at the start of a line and did not recognize the preprocessor directive following it.
Recovery
Check the spelling of the preprocessor directive.
The compiler detected an #include preprocessor directive but could not parse the file name. The file name in the #include directive must be within double quotation marks ("") or angle brackets (<>).
Recovery
Correct the syntax of the file name.
The operand of the "#line" directive must be an integer line number.
Recovery
Ensure that the "#line" directive contains an integer line number operand.
An active definition already exists for the macro name being defined. The last definition will be used.
Recovery
Remove or rename one of the macro definitions.
An "#else", "#elif" or "#endif" preprocessor directive was found out of context.
Recovery
Remove or move the preprocessor directive. Check nesting of #if, #else, #elif, and #endif.
The initializer statement within a "for" statement must be a declaration or expression.
Recovery
Change the for-init-statement to a declaration or an expression.
The name is not declared as a function; there may be parentheses missing after the function name.
Recovery
Correct the declaration.
An array must be defined with at least one element. Use a pointer if you want to dynamically allocate memory for the array.
Recovery
Add an array bound.
The bit-field length, which is the value to the right of the colon, must be an integer. A constant expression has a value that can be determined during compilation and does not change during execution.
Recovery
Change the bit-field length to an integral constant expression.
A derived class attempted to access elements of a class it did not inherit from. A derived class can only access elements of its base class or base classes.
Recovery
Ensure the class names are correct and the classes are derived properly.
The compiler detected an array declaration that did not have a constant that is greater than 0 for the array bounds. Use pointers if you want to dynamically allocate storage for arrays.
Recovery
Change the array bound to an integral constant expression or change it to a pointer. A constant expression has a value that can be determined during compilation and does not change during execution.
The compiler has detected conflicting names for objects within a class declaration. Nested class declarations must have different names.
Recovery
Change the name of the conflicting class.
The compiler has detected an incorrect destructor call.
Recovery
Check the call to the destructor to ensure no braces are missing. If the braces are correct, remove the destructor call.
The compiler detected an initializer where one is not permitted. For example, a class member declarator cannot contain an initializer.
Recovery
Remove the initializer.
You cannot nest functions in C++.
Recovery
Ensure that a "}" is not missing before the start of the function. Remove the nested function.
The compiler detected a string that was not terminated before an end-of-line character was found.
Recovery
End the string before the end of the line, or use "\" to continue the string on the next line. The "\" must be the last character on the line.
The linkage string in a linkage declaration is not one of the linkages supported by this compiler.
Recovery
Change the linkage string to a valid value.
A syntax error was found during preprocessing. The message identifies what the compiler expected and what it actually found.
Recovery
Correct the syntax.
The compiler detected an expression followed by the function call operator. The expression must be of type function, pointer to function, or reference to function.
Recovery
Change the type of expression or remove the function call operator.
An attempt to use the C++ keyword "this" was detected outside class scope. The keyword "this" cannot be used outside a class member function body.
Recovery
Remove or move the "this" keyword.
The command line contained an option that is not supported. Note that some option parameters must not have spaces between the option and the parameter.
Recovery
Remove the option. Check the syntax of the options.
Recovery
Remove the arguments from the destructor.
The compiler detected a typedef specification that did not have a type associated with it.
Recovery
Add a type specification to the declaration.
The compiler detected a return type where one is not permitted. For example, putting a return type on a constructor is not permitted.
Recovery
Remove the return type specification for the function.
Explicit class qualification is not allowed in this context.
Recovery
Remove the class qualification.
The compiler detected an illegal operator between two operands. For user-defined types, you must overload the operator to accept the user-defined types.
Recovery
Change the operator or change the operands.
The type conversion cannot be performed because there is no conversion between the types. This can occur in an initialization, assignment, or expression statement.
Recovery
Change one of the types or overload the operator.
The specified operator must have an operand which is a pointer or an array.
Recovery
Change the operand to either a pointer or an array.
A class name must be specified in this context.
Recovery
Specify a class name. Check the spelling.
The compiler detected an operand that is not an lvalue. An lvalue is an expression that represents an object. For example, the left hand side of an assignment statement must be an lvalue.
Recovery
Change the operand to an lvalue.
You can initialize a const object, but its value cannot change afterwards.
Recovery
Eliminate the const type qualifier from the expression or do not use it with the increment/decrement operators.
The compiler detected a mismatch between the operands of an operator.
Recovery
Change the operand type or use a different operator.
The compiler has detected an element of the initializer list that is not an element of the member list. In the constructor initializer list, you can only initialize immediate base classes and data members not inherited from a base class.
Recovery
Change the constructor initializer list.
An attempt is being made to give a constructor initializer list to a non-constructor function. A constructor initializer list is only allowed for a constructor function.
Recovery
Remove the constructor initializer list.
The compiler has detected a default argument initialized by a parameter.
Recovery
Remove the parameter from the default argument initialization.
The compiler detected more initializers than were present in the function declaration.
Recovery
Remove one or more initializers from the initializer list. Make sure the number of initializers in the initializer list corresponds to the number of arguments in the function declaration.
Recovery
Remove the initializer or remove the "new" allocation.
The bit-field length must not exceed the maximum bit size of the bit-field type.
Recovery
Reduce the bit-field length.
The compiler detected a conflict in a type declaration.
Recovery
Change the type.
The compiler detected function argument types that did not match.
Recovery
Change the argument declarations of the functions.
The compiler has detected a duplicate default initializer value for the same argument in both overloaded functions or in both templates.
Recovery
Ensure that you wanted to declare the same function or template. If that is the case, remove one of the default initializers. Otherwise, remove one of the declarations or overload the function.
No variant of the overloaded function matches the argument list. The argument mismatch could be by type or number of arguments.
Recovery
Change the argument list on the call to the overloaded function or change the argument list on one of the overloaded function variants so that a match is found.
More than one variant of the overloaded function matches equally well with the argument list specified on the call.
Recovery
Change the argument list on the call to the overloaded function or change the argument list on one of the overloaded function variants so that only one match is found.
The specified name has already been declared with a different linkage than the current declaration.
Recovery
Remove the redefinition or change one of the names.
The keyword "operator" can only be used to declare an operator function.
Recovery
Check the declaration of the operator and make sure the function declarator () appears after it. Use the "operator" keyword to declare an operator function or remove it.
The specified operator must have an operand which is of type pointer to member.
Recovery
Change the operand to type pointer to member.
You cannot declare a function with a function or an array as its return type.
Recovery
Declare the function to return a pointer to the function or the array element type.
The C++ language does not allow the declaration of an array of functions or references, or an array of type void.
Recovery
Remove the declaration or change the declaration so that it is an array of pointer to functions, pointers to references, or pointers to void.
You can only assign a value to a const variable using an initializer. This variable has no initializer, so it can never be given a value.
Recovery
Initialize the variable or remove the "const" keyword.
The compiler detected a non-static member making a reference to an object that has not been instantiated. You can reference only static members without associating them with an instance of the containing class.
Recovery
Check the spelling and the class definition. Change the name of the class or function, or define the function as static in that class.
The class is used explicitly as the scope qualifier of the member name, but the class does not contain a member of that name.
Recovery
Check the spelling of the scope qualifier. Change the scope qualifier to the class containing that member, or remove it.
A function or an explicit cast has been specified with the wrong number of arguments.
Recovery
Use the correct number of arguments. Ensure that overloaded functions have the correct number and type of arguments.
Conversion functions and certain operator functions must be class members. They cannot be defined globally.
Recovery
Remove the global definition or make the function a class member.
The function being declared has restrictions on what types its arguments can have. The specified type is not allowed for this argument.
Recovery
Change the argument type.
The specified operator function has the wrong return type.
Recovery
Change the return type.
This error may result from the incorrect use of the array operator.
Recovery
Change the operands of the array operator.
The number of arguments in the function call does not match the number of arguments in the function declaration.
Recovery
Ensure the function declaration and function call specify the same number of arguments.
This message has been generated by the "#error" preprocessor directive, which is a user-defined error message placed in the source code.
The specified operator cannot be used with operands of this type.
Recovery
Change either the operator or the operands.
The compiler ran out of memory during compilation.
Recovery
End unnecessary processes and recompile.
If a function is overloaded, at most one of its variants can have non-C++ linkage.
Recovery
Remove one of the non-C++ linkages or do not overload the function.
A syntax error was found while parsing the program. The message identifies what the compiler expected and what it actually found. Often the source of the error is an unmatched parenthesis or a missing semicolon.
Recovery
Correct the syntax.
The attribute or name cannot be specified in the given context. The compiler detected incompatible names that conflict with the language definition.
Recovery
Remove the attribute or name.
The declaration conflicts with a previous declaration of the same symbol.
Recovery
Remove one of the declarations or make them identical.
The string initializer for a character or wide-character array has more characters than the array. Note that the trailing null character is treated as part of the initializer.
Recovery
Increase the size of the array or reduce the size of the initializer.
The "operator->" function must return either a class type, a reference to a class type, or a pointer to class type, and the class type must itself have an "operator->" function.
Recovery
Change the return value of the "operator->" function.
An unnamed class or struct definition was found that has no object associated with it. The definition can never be referenced. A class can be unnamed, but it cannot be passed as an argument or returned as a value. An unnamed class cannot have any constructors or destructors.
Recovery
Create an object for the class or struct, or remove the definition.
The compiler detected an error that it is not able to recover from. The error was found within the compiler itself.
Recovery
Note the line and module references in this message. Contact your IBM Representative.
The member has been explicitly given the specified class as a scope qualifier but the class (and hence the member) has not been defined.
Recovery
Check for a missing #include file. Define the class and member.
The relationship between the classes in a pointer conversion is not known. If the target class is later defined as a base class of the source class in a multiple inheritance, this conversion will be wrong if the value of the pointer should have been modified by the conversion.
Recovery
Change the ambiguous reference in the conversion.
The specified symbol is being used but has not been assigned a valid value. Its value will be undefined.
Recovery
Define or initialize the symbol before using it.
![]()
Summary of Compiler Error Messages