[fpc-pascal] How to call lib routines with cdecl calling convention with win32 app?

Coco Pascal coco.pascal at xs4all.nl
Sun May 31 21:16:40 CEST 2009


Jonas Maebe schreef:
>
> On 31 May 2009, at 20:05, Coco Pascal wrote:
>
>> I tried
>> function Y_Odd(const AValue: Int64): LongInt; cdecl; alias: '_Y_Odd'; 
>> export;
>> and
>> function Y_Odd(const AValue: Int64): LongInt; cdecl; alias: 
>> '__Y_Odd'; export;
>> but still I get the message entrypoint of 'Y_Odd' could not be found 
>> in 'libyfbudf.dll'
>
> Then you may want to use some tool to look at the name of the entry 
> point in the dll for the cdecl case, and compare it to the stdcall 
> case. Since I don't use Windows, I cannot help you with this.
>
>
Thanks for the tip! The name in the dll is _Y_Odd indeed.
Is it not the function header in the dll that must extended with alias: 
'_Y_Odd'. The function declaration in the app should be:
function _Y_Odd(const AValue: Int64): LongInt; cdecl; external 
'libyfbudf.dll';




More information about the fpc-pascal mailing list