next up previous contents
Next: Assembler reader errors. Up: Compiler error messages Previous: Compiler error messages

Compiler errors

The following is a list of general compiler errors.

unexpected end of file
this typically happens in on of the following cases :
duplicate identifier:
The identifier was already declared in the current scope.
syntax error:
An error against the Turbo Pascal language was encountered. This happens typically when an illegal character is found in the sources file.
Parser - syntax error
An error against the Turbo Pascal language was encountered. This happens typically when an illegal character is found in the sources file.
out of memory
The compiler doesn't have enough memory to compile your program. There are several remedies for this:
unknown identifier
The identifier encountered hasn't been declared, or is used outside the scope where it's defined.
illegal character
An illegal character was encountered in the input file.
source too long
The compiler cannot cope with source files longer than (???)
procedure type INLINE not supported
You tried to compile a program with C++ style inlining, and forgot to specify the -Si option (See 5.1). The compiler doesn't support C++ styled inlining by default.
procedure type NEAR ignored
This is a warning. NEAR is a construct for 8 or 16 bit programs. Since the compile generates 32 bit programs, it ignores this directive.
procedure type FAR ignored
This is a warning. FAR is a construct for 8 or 16 bit programs. Since the compile generates 32 bit programs, it ignores this directive.
INTERRUPT ignored
Interrupt procedures aren't possible on operating systems, other than DOS, it isn't allowed to take over an interrupt at the user level. (versions older than 0.9.2 didn't have INTERRUPT support.
private methods shouldn't be VIRTUAL
You declared a method in the private part of a object (class) as virtual. This is not allowed. Private methods cannot be overridden anyway.
constructor can't be private or protected
Constructors must be in the 'public' part of an object (class) declaration.
destructor can't be private or protected
Destructors must be in the 'public' part of an object (class) declaration.
identifier not found
local class definitions are not allowed
Classes must be defined globally.
anonym class definitions are not allowed
type identifier expected
The identifier is not a type, or you forgot to supply a type identifier.
identifier already as type identifier declared
You are trying to redefine a type.
type identifier not defined
The compiler encountered an unknown type.
type mismatch
This can happen in many cases:
statement expected

illegal integer constant
You made an exression which isn't an integer, and the compiler expects the result to be an integer.
illegal expression
expression too complicated - FPU stack overflow
Your expression is too long for the compiler. You should try dividing the construct over multiple assignments.
CONTINUE not allowed
You're trying to use continue outside a loop construction.
BREAK not allowed
You're trying to use break outside a loop construction.
illegal qualifier
One of the following is appending :
illegal counter variable
The type of a for loop must be ordinal.
ordinal value expected
The expression must be of ordinal type (i.e. maximum a Longint)
high range limit < low range limit
You are declaring a subrange, and the lower limit is higher than the high limit of the range.
illegal unit name
The name of the unit doesn't match the file name.
unknown format of unit file
The unit the compiler is trying to read is corrupted, or generated with a newer version of the compiler.
Reading PPU-File
The unit the compiler is trying to read is corrupted, or generated with a newer version of the compiler.
Invalid PPU-File entry
The unit the compiler is trying to read is corrupted, or generated with a newer version of the compiler.
circular unit use
Two units are using each other in the interface part. This is only allowed in the implementation part.
too many units
Free Pascal has a limit of 1024 units in a program. You can change this behavior by changing the maxunits constant in the files.pas file of the compiler, and recompiling the compiler.
illegal char constant
The compiler expects a character constant, but finds something else.
overloaded identifier isn't a function identifier
The compiler encountered a symbol with the same name a s an overloaded function, but it isn't a function it can overload.
overloaded functions have the same parameter list
You're declaring overloaded functions, but with the same parameter list. Overloaded function must have at least 1 different parameter in their declaration.
illegal parameter list
You are calling a function with parameters that are of a different type than the declared parameters of the function.
can't determine which overloaded function to call
You're calling overloaded functions with a parameter that doesn't correspond to any of the declared function parameter lists. e.g. when you have declared a function with parameters word and longint, and then you call it with a parameter which is of type integer.
forward declaration not solved:
This can happen in two cases:
input file not found
Free Pascal cannot find the program or unit source file, or the included file isn't found.
function header doesn't match the forward declaration
You declared the function in the interface part, or with the forward directive, but define it with a different parameter list.
unknown field identifier
The field doesn't exist in the record definition.
parameter list size exceeds 65535 bytes
The I386 processor limits the parameter list to 65535 bytes (the RET instruction causes this)
function nesting > 31
You can nest function definitions only 31 times.
illegal compiler switch
You included a compiler switch (i.e. {$... }) which the compiler doesn't know.
can't open include file
You want to include (i.e {$i file}) which the compiler doesn't find. Check if the filename is correct.
record or class type expected
The variable or expression isn't of the type record or class.
only values can be jumped over in enumeration types
Free Pascal allows enumeration constructions as in C. Given the following declaration two declarations:
type a = (A_A,A_B,A_E=:6,A_UAS:=200);
type a = (A_A,A_B,A_E=:6,A_UAS:=4);
The second declaration would produce an error. A_UAS needs to have a value higher than A_E, i.e. at least 7.
pointer type expected
The variable or expression isn't of the type pointer.
unit is compiled for another operating system
The unit was compiled with a different target than the target for which you're compiling now. (see the option -T See 5.1).
typed constants of classes are not allowed
You cannot declare a constant of type class or object.
duplicate case label
You are specifying the same label 2 times in a case statement.
range check error while evaluating constants
The constants are out of their allowed range.
illegal type conversion
When doing a type-cast, you must take care that the sizes of the variable and the destination type are the same.
class type expected
The variable of expression isn't of the type class.
functions variables of overloaded functions are not allowed
You are trying to assign an overloaded function to a procedural variable. This isn't allowed.
can't create assembler file
The assembler output file cannot be opened. This can have many causes, but 'disk full' is a reasonable guess.
string length must be a value from 1 to 255
The length of a string in Pascal is limited to 255 characters. You are trying to declare a string with length greater than 255.
class identifier expected
The variable isn't of type class.
method identifier expected
This identifier is not a method.
function header doesn't match any method of this class
You are defining a function as a class method, but no such function was declared in the class.
use extended syntax of DISPOSE and NEW to generate instances of classes
If you have a pointer a to a class type, then the statement new(a) will not initialize the class (i.e. the constructor isn't called), although space will be allocated. you should issue the new(a,init) statement. This will allocate space, and call the constructor of the class.
file types must be var parameters
You cannot specify files as value parameters, i.e. they must always be declared var parameters.
string exceeds line
You forgot probably to include the closing ' in a string, so it occupies multiple lines.
illegal version of the unit:
This unit was compiled with an earlier version of Free Pascal.
illegal floating point constant
destructors can't have parameters
You are declaring a destructor with a parameter list. Destructor methods cannot have parameters.
FAIL can be used in constructors only
You are using the FAIl instruction outside a constructor method.
records fields can be aligned to 1,2 or 4 bytes only
You are specifying the {$PACKRECORDS n} with an illegal value for n. Only 1,2 or 4 are valid in this case.
too many $ENDIFs or $ELSEs
Your {$IFDEF ..} and {$ENDIF} statements aren't balanced.
$ENDIF expected
Your {$IFDEF ..} and {$ENDIF} statements aren't balanced.
illegal call by reference parameters
can't generate DEF file
OS/2 only. The DEF file cannot be generated.
all overloaded methods must be virtual if one is virtual:
If you declare overloaded methods in a class, then they should either all be virtual, or none. You cannot mix them.
overloaded methods which are virtual must have the same return type:
If you declare virtual overloaded methods in a class definition, they must have the same return type.
all overloaded virtual methods must support exceptions if one support exceptions:
If you declare overloaded virtual methods in a class, then they should either all support exceptions, or none. You cannot mix them.
EXPORT declared functions can't be called
You are trying to call a procedure you declared as export. Due to the different calling scheme of Free Pascal and C, you cannot call such a function from within your Pascal program.
EXPORT declared functions can't be nested
You cannot declare a function or procedure within a function or procedure that was declared as an export procedure.
methods can't be EXPORTed
You cannot declare a procedure that is a method for an object as exported. That is, you methods cannot be called from a C program.
SELF is only allowed in methods
You are trying to use the self parameter outside an object's method. Only methods get passed the self parameters.
call by var parameters have to match exactly
When calling a function declared with var parameters, the variables in the function call must be of exactly the same type. There is no automatic type conversion.
class identifier expected
The variable isn't of type class.
class isn't a super class of the current class
When calling inherited methods, you are trying to call a method of a strange class. You can only call an inherited method of a parent class.
methods can be only in other methods called direct with type identifier of the class
A construction like sometype.somemethod is only allowed in a method.
illegal type: pointer to class expected
You specified an illegal type.
possible illegal call of constructor or destructor (doesn't match to this context)
class should have one destructor only
You can declare only one destructor for a class.
expression must be constructor call
When using the extended syntax of new, you must specify the constructor method of the class you are trying to create. The procedure you specified is not a constructor.
identifier idents no member
When using the extended syntax of new, you must specify the constructor method of the class you are trying to create. The procedure you specified does not exist.
expression must be destructor call
When using the extended syntax of dispose, you must specify the destructor method of the class you are trying to dispose of. The procedure you specified is not a destructor.
type conflict between set elements
There is at least one set element which is of the wrong type, i.e. not of the set type.
illegal expression in set constructor
type conflict between set elements
You are specifying elements of a different type for a set.
illegal use of ':'
expression type must be class or record type
The expression isn't of type class or record.
the operator / isn't defined for integer, the result will be real, use DIV instead
When using the '/' operator in Free Pascal the result will be of type real, when used with integers.
can't write PPU file
There is a problem when writing to the unit file.
illegal order of record elements
When declaring a constant record, you specified the fields in the wrong order.
the name of constructors must be INIT
You are declaring a constructor with a name which isn't init, and the -Ss switch is in effect. See the -Ss switch (See 5.1).
the name of constructors must be DONE
You are declaring a constructor with a name which isn't done, and the -Ss switch is in effect. See the -Ss switch (See 5.1).
set element type mismatch
The type of the element doesn't equal the set type.
illegal label declaration
label not found
A goto label was encountered, but the label isn't declared.
GOTO and LABEL are not supported (use command line switch -Sg)
You must compile a program which has labels and goto statements with the -Sg switch. By default, label and goto aren't supported.
set expected
The variable or expression isn't of type set.
identifier isn't a label
The identifier specified after the goto isn't of type label.
label already defined
You're attempting to define a label two times. (i.e. you put the same label on two different places.)
label isn't defined:
A label was declared, but not defined.
constructors and destructors must be methods
You're declaring a procedure as destructor or constructor, when the procedure isn't a class method.
error when assembling
An error occurred when assembling. This can have many causes.
identifier not used:
This is a warning. The identifier was declared (locally or globally) but wasn't used (locally or globally).
functions with void return value can't return any value
In Free Pascal, you can specify a return value for a function when using the exit statement. This error occurs when you try to do this with a procedure. Procedures cannot return a value.
Hmmm..., this code can't be much efficient
You construction seems dubious to the compiler.
unreachable code
You specified a loop which will never be executed. Example:
while false do
  begin
  {.. code ...}
  end;
This overloaded function can't be local (must be exported)
You are defining a overloaded function in the implementation part of a unit, but there is no corresponding declaration in the interface part of the unit.
It's not possible to overload this operator
You are trying to overload an operator which cannot be overloaded.
Abstract methods can't be called direct
Free Pascal understands the abstract keyword.
the mix of CLASSES and OBJECTS are not allowed
You cannot use object and class intertwined.
macro buffer overflow while reading or expanding a macro
Your macro or it's result was too long for the compiler.
keyword redefined as macro has no effect
You cannot redefine keywords with macros.
extension of macros exceeds a deep of 16,
perhaps there is a recursive macro definition (crashes the compiler)
When expanding a macro macros have been nested to a level of 16.
ENDIF without IF(N)DEF
Your code contains more {$ENDIF} than {$IF(N)DEF} statements.
user defined:
A user defined warning occurred. see also the Programmer's guide\
linker: Duplicate symbol:
Two global symbols in the code have the same name.
linker: Error while reading object file
The linker couldn't read the object file (the assembled file).
linker: object file not found
The linker didn't find the object file (the assembled file).
linker: illegal magic number in file:
The linker cannot determine the type of a file it wants to link in. The type of a link file is specified using a magic number, which is some pre-defined constant, unique for each system.
The extended syntax of new or dispose isn't allowed for a class
You cannot generate an instance of a class with the extended syntax of new. The constructor must be used for that. For the same reason, you cannot call Dispose to de-allocate an instance of a class, the destructor must be used for that.
To generate an instance of a class or an object with an abstract method isn't allowed
You are trying to generate an instance of a class which has an abstract method that wasn't overridden.
Only virtual methods can be abstract
You are declaring a method as abstract, when it isn't declared to be virtual.
Abstract methods shouldn't have any definition (with function body)
Abstract methods can only be declared, you cannot implement them. They should be overridden by a descendant class.
can't call the assembler
An error occurred when calling the assembler.
can't call o2obj
An error occurred when calling the o to obj conversion program.
asm syntax error
There is an error in the assembly language.
register name expected
There is an error in the assembly language. The assembler expected a register and got something else.
asm size mismatch
There is an error in the assembly language. The sizes of operands and registers don't match.
no instr match,
There is an error in the assembly language. An unknown instruction was encountered.
can't compile unit:
When trying to do a build, the compiler cannot compile one of the units.
Re-raise isn't possible there
You are trying to raise an exception where it isn't allowed. You can only raise exceptions in an except block.

Syntax error while parsing a conditional compiling expression
Evaluating a conditional compiling expression
There is an error in the expression following the {$if } compiler directive.
Keyword redefined as macro has no effect
You cannot redefine Pascal keywords with macros. If you, for instance would want to redefine the exit command you'd get this error.
compiler switches aren't allowed in (* ... *) styled comments
Compiler switches should always be between { } comment delimiters.
No DLL File specified

Illegal open parameter
You are trying to use the wrong type for an open parameter.
Illegal floating point constant
The compiler expects a floating point expression, and gets something else.
string types doesn't match, because of $V+ mode
When compiling in {$V+ } mode, the string you pass as a parameter should be of the exact same type as the declared parameter of the procedure.
Only class methods can be referred with class references
This error occurs in a situation like the following:
Type :
   Tclass = Class of Tobject;

Var C : TClass;

begin
...
C.free
Free is not a class method and hence cannot be called with a class reference.
Only class methods can be accessed in class methods
This is related to the previous error. You cannot call a method of an object from a inside a class method. The following code would produce this error:
class procedure tobject.x;

begin
  free
Because free is a normal method of a class it cannot be called from a class method.
Constant and CASE types do not match
One of the labels is not of the same type as the case variable.
The symbol can't be exported from a library
You can only export procedures and functions when you write a library. You cannot export variables or constants.
A virtual method must be overridden using the OVERRIDE directive:
A method that is declared virtual in a parent class, should be overridden in the descendent class with the override directive. If you don't specify the override directive, you will hide the parent method; you will not override it.
There is no method in an ancestor class to be overridden:
You try to override a virtual method of a parent class that doesn't exist.
No member is provided to access property
You specified no read directive for a property.
Illegal symbol for property access
There is an error in the read or write directives for an array property. When you declare an array property, you can only access it with procedures and functions. The following code woud cause such an error.
tmyobject = class
  i : integer;
  property x [i : integer]: integer read I write i;

Cannot write a protected field of an object
Fields that are declared in a protected section of an object or class declaration cannot be accessed outside that objects methods.
range check error in set constructor or duplicate set element
The declaration of a set contains an error. Either one of the elements is outside the range of the set type, either two of the elements are in fact the same.
Pointer to class expected
The compiler expects a reference to a class.
Operator is not overloaded
You're trying to use an overloaded operator when it isn't overloaded for this type.
Variable or type indentifier expected

Assembler incompatible with function return value
You're trying to implement a assembler function, but the return type of the function doesn't allow that.
Procedure overloading is switched off
You're trying to compile overloaded procedures with the -So (Turbo Pascal compatibility) switch. Remove the switch.
Comparative operator must return a boolean value
When overloading the = operator, the function must return a boolean value.
Use of unsupported feature!
You're trying to force the compiler into doing something it cannot do yet.
absolute can only be associated to ONE variable
You cannot specify more than one variable before the absolute directive. Thus, the following construct will provide this error:
Var Z : Longint;
    X,Y : Longint absolute Z;
absolute can only be associated a var or const
The address of a absolute directive can only point to a variable or constant. Therefore, the following code will produce this error:
  Procedure X;

 var p : longint absolute x;

succ or pred on enums with assignments not possible
When you declared an enumeration type which has assignments in it, as in C, like in the following:
  Tenum = (a,b,e:=5);
you cannot use the Succ or Pred functions on them.
Array properties aren't allowed at this point
Indexed properties are not yet implemented.
No property found to override
You want to overrride a property of a parent class, when there is, in fact, no such property in the parent class.
Only one default property is allowed, found inherited default property in class
You specified a property as Default, but a parent class already has a default property, and a class can have only one default property.
The default property must be an array property
Only array properties of classes can be made default properties.
Internal Error in SymTableStack()
An internal error occurred in the compiler; If you encounter such an error, please contact the developers and try to provide an exact description of the circumstances in which the error occurs.
Error in type definition
There is an error in your definition of a new type.
Only static variables can be used in static methods or outside methods
A static method of an object can only access static variables.
Invalid call to tvarsym.mangledname()
An internal error occurred in the compiler; If you encounter such an error, please contact the developers and try to provide an exact description of the circumstances in which the error occurs.
illegal type declaration of set elements
The declaration of a set contains an invalid type definition.
Forward class definition not resolved
You declared a class, but you didn't implement it.
identifier idents no member
You specify a field of a record or object, and the record or object doesn't contains such a field.
The use of a far pointer isn't allowed there
Free Pascal doesn't support far pointers, so you cannot take the address of an expression which has a far reference as a result. The mem construct has a far reference as a result, so the following code will produce this error:
var p : pointer;
...
p:=@mem[a000:000];
procedure call with stackframe ESP/SP
A procedure doesn't need a complete stack-frame, so it is omitted.
Abstract methods can't be called directly
You cannot call an abstract method directy, instead you must call a overriding child method, because an abstract method isn't implemented.
Internal Error in getfloatreg(), allocation failure
An internal error occurred in the compiler; If you encounter such an error, please contact the developers and try to provide an exact description of the circumstances in which the error occurs.
Unknown float type
The compiler cannot determine the kind of float in an expression.
SecondVecn() base defined twice
An internal error occurred in the compiler; If you encounter such an error, please contact the developers and try to provide an exact description of the circumstances in which the error occurs.
Extended cg68k not supported
32-bit unsigned not supported in MC68000 mode
The cardinal type isn't supported on the MC68000 processor.
Internal Error in secondinline()
An internal error occurred in the compiler; If you encounter such an error, please contact the developers and try to provide an exact description of the circumstances in which the error occurs.
Stack limit excedeed in local routine
Your code requires a too big stack. Some operating systems pose limits on the stack size. You should use less variables or try ro put large variables on the heap.


next up previous contents
Next: Assembler reader errors. Up: Compiler error messages Previous: Compiler error messages

Michael Van Canneyt
Thu Sep 10 13:56:17 CEST 1998