[next] [prev] [prev-tail] [tail] [up]

### C.3 Parser messages

This section lists all parser messages. The parser takes care of the semantics of you language, i.e. it determines if your pascal constructs are correct.

Error: 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.
Warning: 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.
Warning: 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.
Warning: Procedure type INTERRUPT ignored for not i386
  This is a warning. INTERRUPT is a i386 specific construct and is ignored for other processors.
Error: INTERRUPT procedure can’t be nested
  An INTERRUPT procedure must be global.
Warning: Procedure type arg1 ignored
  This is a warning. REGISTER,REINTRODUCE is ignored by FPC programs for now. This is introduced first for Delphi compatibility.
Error: Not all declarations of arg1 are declared with OVERLOAD
  When you want to use overloading using the OVERLOAD directive, then all declarations need to have OVERLOAD specified.
Error: No DLL File specified
  No longer in use.
Error: Duplicate exported function name arg1
  Exported function names inside a specific DLL must all be different
Error: Duplicate exported function index arg1
  Exported function names inside a specific DLL must all be different
Error: Invalid index for exported function
  DLL function index must be in the range 1..$FFFF
Warning: Relocatable DLL or executable arg1 debug info does not work, disabled.
Warning: To allow debugging for win32 code you need to disable relocation with -WN option
  Stabs info is wrong for relocatable DLL or EXES use -WN if you want to debug win32 executables.
Error: Constructor name 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 (-Ss, (see page 5.1)).
Error: Destructor name must be DONE
  You are declaring a destructor with a name which isn’t done, and the -Ss switch is in effect. See the -Ss switch (-Ss, (see page 5.1)).
Error: Illegal open parameter
  You are trying to use the wrong type for an open parameter.
Error: Procedure type INLINE not supported
  You tried to compile a program with C++ style inlining, and forgot to specify the -Si option (-Si, (see page 5.1)). The compiler doesn’t support C++ styled inlining by default.
Warning: 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.
Warning: Constructor should be public
  Constructors must be in the ’public’ part of an object (class) declaration.
Warning: Destructor should be public
  Destructors must be in the ’public’ part of an object (class) declaration.
Note: Class should have one destructor only
  You can declare only one destructor for a class.
Error: Local class definitions are not allowed
  Classes must be defined globally. They cannot be defined inside a procedure or function
Fatal: Anonym class definitions are not allowed
  An invalid object (class) declaration was encountered, i.e. an object or class without methods that isn’t derived from another object or class. For example:

             Type o = object
                      a : longint;
                      end;

  will trigger this error.
Error: The object arg1 has no VMT
Error: Illegal parameter list
  You are calling a function with parameters that are of a different type than the declared parameters of the function.
Error: Wrong parameter type specified for arg no. arg1
  There is an error in the parameter list of the function or procedure. The compiler cannot determine the error more accurate than this.
Error: Wrong amount of parameters specified
  There is an error in the parameter list of the function or procedure, the number of parameters is not correct.
Error: overloaded identifier arg1 isn’t a function
  The compiler encountered a symbol with the same name as an overloaded function, but it isn’t a function it can overload.
Error: 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.
Error: function header doesn’t match the forward declaration arg1
  You declared a function with same parameters but different result type or function modifiers.
Error: function header arg1 doesn’t match forward : var name changes arg2 =¿ arg3
  You declared the function in the interface part, or with the forward directive, but define it with a different parameter list.
Note: Values in enumeration types have to be ascending
  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.
Note: Interface and implementation names are different arg1 =¿ arg2
  This note warns you if the implementation and interface names of a functions are different, but they have the same mangled name. This is important when using overloaded functions (but should produce no error).
Error: With can not be used for variables in a different segment
  With stores a variable locally on the stack, but this is not possible if the variable belongs to another segment.
Error: function nesting ¿ 31
  You can nest function definitions only 31 times.
Error: range check error while evaluating constants
  The constants are out of their allowed range.
Warning: range check error while evaluating constants
  The constants are out of their allowed range.
Error: duplicate case label
  You are specifying the same label 2 times in a case statement.
Error: Upper bound of case range is less than lower bound
  The upper bound of a case label is less than the lower bound and this is useless
Error: typed constants of classes are not allowed
  You cannot declare a constant of type class or object.
Error: functions variables of overloaded functions are not allowed
  You are trying to assign an overloaded function to a procedural variable. This isn’t allowed.
Error: 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 lower than 1 or greater than 255 (This is not true for Longstrings and AnsiStrings.
Warning: use extended syntax of NEW and DISPOSE for instances of objects
  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.
Warning: use of NEW or DISPOSE for untyped pointers is meaningless
Error: use of NEW or DISPOSE is not possible for untyped pointers
  You cannot use new(p) or dispose(p) if p is an untyped pointer because no size is associated to an untyped pointer. Accepted for compatibility in tp and delphi modes.
Error: class identifier expected
  This happens when the compiler scans a procedure declaration that contains a dot, i.e., a object or class method, but the type in front of the dot is not a known type.
Error: type identifier not allowed here
  You cannot use a type inside an expression.
Error: method identifier expected
  This identifier is not a method. This happens when the compiler scans a procedure declaration that contains a dot, i.e., a object or class method, but the procedure name is not a procedure of this type.
Error: function header doesn’t match any method of this class arg1
  This identifier is not a method. This happens when the compiler scans a procedure declaration that contains a dot, i.e., a object or class method, but the procedure name is not a procedure of this type.
procedure/function arg1
  When using the -vp switch, the compiler tells you when it starts processing a procedure or function implementation.
Error: Illegal floating point constant
  The compiler expects a floating point expression, and gets something else.
Error: FAIL can be used in constructors only
  You are using the FAIL instruction outside a constructor method.
Error: Destructors can’t have parameters
  You are declaring a destructor with a parameter list. Destructor methods cannot have parameters.
Error: 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.
Error: 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.
Error: Constant and CASE types do not match
  One of the labels is not of the same type as the case variable.
Error: 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.
Warning: An inherited method is hidden by arg1
  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.
Error: There is no method in an ancestor class to be overridden: arg1
  You try to override a virtual method of a parent class that doesn’t exist.
Error: No member is provided to access property
  You specified no read directive for a property.
Warning: Stored prorperty directive is not yet implemented
  The stored directive is not yet implemented
Error: 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;

Error: Cannot access a protected field of an object here
  Fields that are declared in a protected section of an object or class declaration cannot be accessed outside the module wher the object is defined, or outside descendent object methods.
Error: Cannot access a private field of an object here
  Fields that are declared in a private section of an object or class declaration cannot be accessed outside the module where the class is defined.
Warning: overloaded method of virtual method should be virtual: arg1
  If you declare overloaded methods in a class, then they should either all be virtual, or none. You shouldn’t mix them.
Warning: overloaded method of non-virtual method should be non-virtual: arg1
  If you declare overloaded methods in a class, then they should either all be virtual, or none. You shouldn’t mix them.
Error: overloaded methods which are virtual must have the same return type: arg1
  If you declare virtual overloaded methods in a class definition, they must have the same return type.
Error: 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.
Error: methods can’t be EXPORTed
  You cannot declare a procedure that is a method for an object as exported. That is, your methods cannot be called from a C program.
Error: call by var parameters have to match exactly: Got arg1 expected arg2
  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.
Error: Class isn’t a parent 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.
Error: 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.
Error: 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.
Error: Illegal use of ’:’
  You are using the format : (colon) 2 times on an expression that is not a real expression.
Error: 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.
Error: Pointer to object expected
  You specified an illegal type in a New statement. The extended synax of New needs an object as a parameter.
Error: Expression must be constructor call
  When using the extended syntax of new, you must specify the constructor method of the object you are trying to create. The procedure you specified is not a constructor.
Error: Expression must be destructor call
  When using the extended syntax of dispose, you must specify the destructor method of the object you are trying to dispose of. The procedure you specified is not a destructor.
Error: Illegal order of record elements
  When declaring a constant record, you specified the fields in the wrong order.
Error: Expression type must be class or record type
  A with statement needs an argument that is of the type record or class. You are using with on an expression that is not of this type.
Error: Procedures can’t return a 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.
Error: constructors and destructors must be methods
  You’re declaring a procedure as destructor or constructor, when the procedure isn’t a class method.
Error: Operator is not overloaded
  You’re trying to use an overloaded operator when it isn’t overloaded for this type.
Error: Impossible to overload assignment for equal types
  You can not overload assignment for types that the compiler considers as equal.
Error: Impossible operator overload
  The combination of operator, arguments and return type are incompatible.
Error: 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.
Error: 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.
Error: Assembler incompatible with function return type
  You’re trying to implement a assembler function, but the return type of the function doesn’t allow that.
Error: Procedure overloading is switched off
  When using the -So switch, procedure overloading is switched off. Turbo Pascal does not support function overloading.
Error: It is not possible to overload this operator (overload = instead)
  You are trying to overload an operator which cannot be overloaded. The following operators can be overloaded :

                +, -, *, /, =, >, <, <=, >=, is, as, in, **, :=

Error: Comparative operator must return a boolean value
  When overloading the = operator, the function must return a boolean value.
Error: Only virtual methods can be abstract
  You are declaring a method as abstract, when it isn’t declared to be virtual.
Fatal: Use of unsupported feature!
  You’re trying to force the compiler into doing something it cannot do yet.
Error: The mix of CLASSES and OBJECTS isn’t allowed
  You cannot derive objects and classes intertwined . That is, a class cannot have an object as parent and vice versa.
Warning: Unknown procedure directive had to be ignored: arg1
  The procedure direcive you secified is unknown. Recognised procedure directives are cdecl, stdcall, popstack, pascal register, export.
Error: 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;

Error: 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;

Error: Only ONE variable can be initialized
  You cannot specify more than one variable with a initial value in Delphi syntax.
Error: 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.
Error: 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.
Warning: Virtual methods are used without a constructor in arg1
  If you declare objects or classes that contain virtual methods, you need to have a constructor and destructor to initialize them. The compiler encountered an object or class with virtual methods that doesn’t have a constructor/destructor pair.
Macro defined: arg1
  When -vm is used, the compiler tells you when it defines macros.
Macro undefined: arg1
  When -vm is used, the compiler tells you when it undefines macros.
Macro arg1 set to arg2
  When -vm is used, the compiler tells you what values macros get.
Info: Compiling arg1
  When you turn on information messages (-vi), the compiler tells you what units it is recompiling.
Parsing interface of unit arg1
  This tells you that the reading of the interface of the current unit starts
Parsing implementation of arg1
  This tells you that the code reading of the implementation of the current unit, library or program starts
Compiling arg1 for the second time
  When you request debug messages (-vd) the compiler tells you what units it recompiles for the second time.
Error: Array properties aren’t allowed here
  You cannot use array properties at that point in the source.
Error: 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.
Error: Only one default property is allowed, found inherited default property in class arg1
  You specified a property as Default, but a parent class already has a default property, and a class can have only one default property.
Error: The default property must be an array property
  Only array properties of classes can be made default properties.
Error: Virtual constructors are only supported in class object model
  You cannot have virtual constructors in objects. You can only have them in classes.
Error: No default property available
  You try to access a default property of a class, but this class (or one of it’s ancestors) doesn’t have a default property.
Error: The class can’t have a published section, use the $M+ switch
  If you want a published section in a class definition, you must use the {$M+} switch, whch turns on generation of type information.
Error: Forward declaration of class arg1 must be resolved here to use the class as ancestor
  To be able to use an object as an ancestor object, it must be defined first. This error occurs in the following situation:

              Type ParentClas = Class;
                   ChildClass = Class(ParentClass)
                     ...
                   end;

  Where ParentClass is declared but not defined.
Error: Local operators not supported
  You cannot overload locally, i.e. inside procedures or function definitions.
Error: Procedure directive arg1 not allowed in interface section
  This procedure directive is not allowed in the interface section of a unit. You can only use it in the implementation section.
Error: Procedure directive arg1 not allowed in implementation section
  This procedure directive is not defined in the implementation section of a unit. You can only use it in the interface section.
Error: Procedure directive arg1 not allowed in procvar declaration
  This procedure directive cannot be part of a procedural or function type declaration.
Error: Function is already declared Public/Forward arg1
  You will get this error if a function is defined as forward twice. Or it is once in the interface section, and once as a forward declaration in the implmentation section.
Error: Can’t use both EXPORT and EXTERNAL
  These two procedure directives are mutually exclusive
Error: NAME keyword expected
  The definition of an external variable needs a name clause.
Warning: arg1 not yet supported inside inline procedure/function
  Inline procedures don’t support this declaration.
Warning: Inlining disabled
  Inlining of procedures is disabled.
Info: Writing Browser log arg1
  When information messages are on, the compiler warns you when it writes the browser log (generated with the {$Y+ } switch).
Hint: Maybe pointer dereference is missing
  The compiler thinks that a pointer may need a dereference.
Fatal: Selected assembler reader not supported
  The selected assembler reader (with {$ASMMODE xxx} is not supported. The compiler can be compiled with or without support for a particular assembler reader.
Error: Procedure directive arg1 has conflicts with other directives
  You specified a procedure directive that conflicts with other directives. for instance cdecl and pascal are mutually exclusive.
Error: Calling convention doesn’t match forward
  This error happens when you declare a function or procedure with e.g. cdecl; but omit this directive in the implementation, or vice versa. The calling convention is part of the function declaration, and must be repeated in the function definition.
Error: Register calling (fastcall) not supported
  The register calling convention, i.e., arguments are passed in registers instead of on the stack is not supported. Arguments are always passed on the stack.
Error: Property can’t have a default value
  Set properties or indexed properties cannot have a default value.
Error: The default value of a property must be constant
  The value of a default declared property must be known at compile time. The value you specified is only known at run time. This happens .e.g. if you specify a variable name as a default value.
Error: Symbol can’t be published, can be only a class
  Only class type variables can be in a published section of a class if they are not declared as a property.
Error: That kind of property can’t be published
  Properties in a published section cannot be array properties. they must be moved to public sections. Properties in a published section must be an ordinal type, a real type, strings or sets.
Warning: Empty import name specified
  Both index and name for the import are 0 or empty
Warning: An import name is required
  Some targets need a name for the imported procedure or a cdecl specifier
Error: Function internal name changed after use of function
  This is an internal error; please report any occurrences of this error to the Free Pascal team.
Error: Division by zero
  There is a divsion by zero encounted
Error: Invalid floating point operation
  An operation on two real type values produced an overflow or a division by zero.
Error: Upper bound of range is less than lower bound
  The upper bound of a case label is less than the lower bound and this is not possible
Warning: string ”arg1” is longer than arg2
  The size of the constant string is larger than the size you specified in string type definition
Error: string length is larger than array of char length
  The size of the constant string is larger than the size you specified in the array[x..y] of char definition
Error: Illegal expression after message directive
  Free Pascal supports only integer or string values as message constants
Error: Message handlers can take only one call by ref. parameter
  A method declared with the message-directive as message handler can take only one parameter which must be declared as call by reference Parameters are declared as call by reference using the var-directive
Error: Duplicate message label: arg1
  A label for a message is used twice in one object/class
Error: Self can only be an explicit parameter in mehtods that are message handlers
  The self parameter can only be passed explicitly to a method which is declared as message method handler.
Error: Threadvars can be only static or global
  Threadvars must be static or global, you can’t declare a thread local to a procedure. Local variables are always local to a thread, because every thread has it’s own stack and local variables are stored on the stack
Fatal: Direct assembler not supported for binary output format
  You can’t use direct assembler when using a binary writer, choose an other outputformat or use an other assembler reader
Warning: Don’t load OBJPAS unit manual, use mode switch instead
  You’re trying to load the ObjPas unit manual from a uses clause. This is not a good idea to do, you can better use the {$mode objfpc} or {$mode delphi} directives which load the unit automaticly
Error: OVERRIDE can’t be used in objects
  Override isn’t support for objects, use VIRTUAL instead to override a method of an anchestor object
Error: Data types which requires initialization/finalization can’t be used in variant records
  Some data type (e.g. ansistring) needs initialization/finalization code which is implicitly generated by the compiler. Such data types can’t be used in the variant part of a record.
Error: Resourcestrings can be only static or global
  Resourcestring can not be declared local, only global or using the static directive.
Error: Exit with argument can’t be used here
  an exit statement with an argument for the return value can’t be used here, this can happen e.g. in try..except or try..finally blocks
Error: The type of the storage symbol must be boolean
  If you specify a storage symbol in a property declaration, it must be of the type boolean
Error: This symbol isn’t allowed as storage symbol
  You can’t use this type of symbol as storage specifier in property declaration. You can use only methods with the result type boolean, boolean class fields or boolean constants
Error: Only class which are compiled in $M+ mode can be published
  In the published section of a class can be only class as fields used which are compiled in {$M+} or which are derived from such a class. Normally such a class should be derived from TPersitent
Error: Procedure directive expected
  When declaring a procedure in a const block you used a ; after the procedure declaration after which a procedure directive must follow. Correct declarations are:

             const
               p : procedure;stdcall=nil;
               p : procedure stdcall=nil;

Error: The value for a property index must be of an ordinal type
  The value you use to index a property must be of an ordinal type, for example an integer or enumerated type.
Error: Procedure name to short to be exported
  The length of the procedure/function name must be at least 2 characters long. This is because of a bug in dlltool which doesn’t parse the .def file correct with a name of length 1.
Error: No DEFFILE entry can be generated for unit global vars
Error: Compile without -WD option
  You need to compile this file without the -WD switch on the commandline
Fatal: You need ObjFpc (-S2) or Delphi (-Sd) mode to compile this module
  You need to use {$mode objfpc} or {$mode delphi} to compile this file. Or use the equivalent commandline switches -S2 or -Sd.
Error: Can’t export with index under arg1
  Exporting of functions or procedures with a specified index is not support on all targets. The only platforms currently supporting export with index are OS/2 and Win32.
Error: Exporting of variables is not supported under arg1
  Exporting of variables is not support on all targets. The only platform currently supporting export of variables is Win32.
Error: Type ”arg1” can’t be used as array index type
  Types like DWord or Int64 aren’t allowed as array index type
Warning: Some fields coming before ”arg1” weren’t initialized
  In Delphi mode, not all fields of a typed constant record have to be initialized, but the compiler warns you when it detects such situations.
Error: Some fields coming before ”arg1” weren’t initialized
  In all syntax modes but Delphi mode, you can’t leave some fields uninitialized in the middle of a typed constant record
Hint: Some fields coming after ”arg1” weren’t initialized
  You can leave some fields at the end of a type constant record uninitialized (the compiler will initialize them to zero automatically), but then the compiler gives you a hint when it detects such situations.
Error: Self must be a normal (call-by-value) parameter
  You can’t declare self as a const or var parameter, it must always be a call-by-value parameter
Error: Typed constants of the type ”procedure of object” can only be initialized with NIL
  You can’t assign the address of a method to a typed constant which has a ’procedure of object’ type, because such a constant requires two addresses: that of the method (which is known at compile time) and that of the object or class instance it operates on (which can not be known at compile time).

[next] [prev] [prev-tail] [front] [up]