[fpc-pascal] UDF+FREEBSD+FIREBIRD

KES kes-kes at yandex.ru
Sat Nov 15 07:43:49 CET 2008


Здравствуйте, Michael.

Вы писали 15 ноября 2008 г., 2:52:48:



MVC> On Sat, 15 Nov 2008, KES wrote:

>> Здравствуйте, Michael.

MVC> Zdravstvuyte...

>> >> I have tryied my example to compile in Delphi. Then I use DLL in
>> >> FireBird on Win32. All works fine. So my source file is good
>> >> and therefore FreePascal can not compile shared library that can be
>> >> recognized by FireBird (((
>> 
>> MVC> Did you specify cdecl as the calling convention for non-windows ?
>> MVC> If it works on windows, it almost surely does not work straight out
>> MVC> of the box on unices, because the calling convention will be wrong.
>> 
>> MVC> Michael.
>> 
>> This is last my try:
>> 
>> library MyUDF;
>> 
>> 
>> function somefn: integer; cdecl; export;
>> begin
>>  somefn:= 3;
>> end;
>> 
>> exports
>>  somefn name '_somefn';
>> end.
>> 
>> On win32 it works, on FreeBSD does not

MVC> I compiled the library, and checked the contents:

home: >>objdump -t libmyudf.so  

MVC> 00004a20 g     F .text  00000005 _somefn

MVC> So the symbol is present, as you declared it in your library. 
MVC> That part seems OK.

MVC> How do you declare your function in Firebird ?
MVC> Does it have the _ ? 
MVC> and the correct casing ?

MVC> Michael.

I have tryied with and without _

DECLARE EXTERNAL FUNCTION FNTEST
  RETURNS INTEGER
  ENTRY_POINT 'somefn'
  MODULE_NAME 'myudf'


DECLARE EXTERNAL FUNCTION FNTEST
  RETURNS INTEGER
  ENTRY_POINT '_somefn'
  MODULE_NAME 'myudf'

-- 
С уважением,
 KES                          mailto:kes-kes at yandex.ru




More information about the fpc-pascal mailing list