[Lazarus] Newbie, porting class to FPC but get procedure assignment error
Marc Weustink
marc at dommelstein.nl
Fri Jun 19 23:01:36 CEST 2015
On June 19, 2015 9:44:19 PM GMT+02:00, Bo Berglund <bo.berglund at gmail.com> wrote:
>On Fri, 19 Jun 2015 09:42:35 -0700 (MST), leledumbo
><leledumbo_cool at yahoo.co.id> wrote:
>
>>> The warning about the $F switch concerns a setting to force far
>calls,
>>> what is the equivalent in FPC?
>>
>>http://www.freepascal.org/docs-html/prog/progsu21.html
>>
>>> And I am not sure that COFF is the correct file type to link
>>> against...
>>
>>yes, it is. the fact that you know in undefined symbol step says it
>all. Now
>>you will need to provide how those undefined symbols actually defined.
>They
>>probably occur from external function declaration, which differs from
>>compiler to compiler. For instance:
>>
>>SPROMEPS_RNBOSPROFORMATPACKET$RB_SPRO_APIPACKET_PTR$WORD$$WORD
>>
>>is FPC's way to define:
>>
>>unit SPROMEPS;
>>...
>>function RNBOSPROFORMATPACKET(x: RB_SPRO_APIPACKET_PTR; y: WORD):
>WORD;
>>
>>which is explained here:
>>http://www.freepascal.org/docs-html/prog/progsu141.html#x172-1750006.2.2
>>
>>and the way to modify it, such that you can match with what the object
>file
>>expects:
>>http://www.freepascal.org/docs-html/prog/progsu142.html#x173-1760006.2.3
>>
>>
>
>The error message when compiling the source:
>DongleTest.lpr(22,1) Error: Undefined symbol:
>SPROMEPS_RNBOSPROFORMATPACKET$RB_SPRO_APIPACKET_PTR$WORD$$WORD
>
>In SproMeps.pas:
>
>
>implementation
>FUNCTION RNBOsproFormatPacket( ApiPacket : RB_SPRO_APIPACKET_PTR;
> thePacketSize : WORD ) : WORD; STDCALL;
>EXTERNAL;
>
>
>I did not really understand any of teh discussions in the linked
>articles...
>
>Any idea what to do for this particular functio?
>There are 13 in total..
Just guessing, I've no experience with this.
1) Use the converter tool to dump the exported function names from the original .obj
2) look for an exported name which looks like RNBOsproFormatPacket
3) use the name conversion option of the converter tool to map the name you found to SPROMEPS_RNBOSPROFORMATPACKET$RB_SPRO_APIPACKET_PTR$WORD$$WORD (see manual)
4) do this for all 13 functions
Marc
More information about the Lazarus
mailing list