Recent

Author Topic: Using "exports" in a unit does not compile  (Read 4146 times)

Robert Gilland

  • Full Member
  • ***
  • Posts: 146
Using "exports" in a unit does not compile
« on: May 09, 2014, 01:42:42 am »
The below unit compiles in Delphi but fails in FPC with the following error:

Fatal: Syntax error, "IMPLEMENTATION" expected but "EXPORTS" found


Why?

Kind Regards,

Robert.



unit testexports;

{$IFDEF FPC}
  {$MODE Delphi}
{$ENDIF}

interface

uses Classes, SysUtils;

function GetTestExport( id_ws : Integer; strwsList : string;  procfilescreated : TGetStrProc ): Boolean; stdcall;


exports GetTestExport;

implementation

function GetTestExport( id_ws : Integer; strwsList : string;  procfilescreated : TGetStrProc ): Boolean;
begin
  // do something
end;

end.


Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Using "exports" in a unit does not compile
« Reply #1 on: May 09, 2014, 02:18:49 am »
Because it's syntactically incorrect, unit never has exports section, only library does. What Delphi version? Can you confirm with newer ones (XE family)?

Robert Gilland

  • Full Member
  • ***
  • Posts: 146
Re: Using "exports" in a unit does not compile
« Reply #2 on: May 09, 2014, 02:20:19 am »
This unit compiles perfectly well in Delphi XE

Kind Regards,

Robert.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Using "exports" in a unit does not compile
« Reply #3 on: May 09, 2014, 08:17:05 am »
This unit compiles perfectly well in Delphi XE

Kind Regards,

Robert.
Please file a Delphi compatibility bug report.

Robert Gilland

  • Full Member
  • ***
  • Posts: 146
Re: Using "exports" in a unit does not compile
« Reply #4 on: May 12, 2014, 04:05:19 am »
Could you put the link to where to do this in here?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Using "exports" in a unit does not compile
« Reply #5 on: May 12, 2014, 05:29:05 pm »
Could you put the link to where to do this in here?
Left menu of this forum->bugtracker

Robert Gilland

  • Full Member
  • ***
  • Posts: 146
Re: Using "exports" in a unit does not compile
« Reply #6 on: May 16, 2014, 12:43:13 am »