Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-11

Forward declaration not solved

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Beisel

compiler: fpc 2.2.4
target: go32v2

the following snippet fails compiling:

  UNIT uxy;
  {
  FPC Ver 2.2.4
  Target: Go32V2
  Compiler Error: Forward declaration not soved "doXY(SmallInt, Smallint, Smallint, Char,   Byte);"
  }

  INTERFACE

  procedure doXY( X, Y, Cnt: smallInt; C: Char; A: byte);
  IMPLEMENTATION
  uses graph;
  procedure doXY( X, Y, Cnt: smallInt; C: Char; A: byte);
  begin
  {...}
  end;

  END.

But following code snippet compiles fine (no usage of unit graph):

   UNIT uxy;
   {
   FPC Ver 2.2. 4
   Target: Go32V2
  No Compiler Error
  }

   INTERFACE

     procedure doXY( X, Y, Cnt: smallInt; C: Char; A: byte);

  IMPLEMENTATION

     procedure doXY( X, Y, Cnt: smallInt; C: Char; A: byte);
     begin
    {...}
   end;

   END.

Any ideas?
Regards Peter

Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

Reply by email

Jonas Maebe
to Peter Beisel
Peter Beisel wrote 20 lines
compiler: fpc 2.2.4 target: go32v2 the following snippet fails compiling: UNIT uxy; { FPC Ver 2.2.4 Target: Go32V2 Compiler Error: Forward declaration not soved "doXY(SmallInt, Smallint, Smallint, Char, Byte);" } INTERFACE procedure doXY( X, Y, Cnt: smallInt; C: Char; A: byte); IMPLEMENTATION uses graph;

The problem is that the graph unit also defines a smallint type. Either add graph to the interface of your unit, or use system.smallint in the implementation.

Jonas

Reply by email