[fpc-pascal] UDF+FREEBSD+FIREBIRD

KES kes-kes at yandex.ru
Thu Nov 13 17:59:05 CET 2008


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

Вы писали 12 ноября 2008 г., 23:12:43:

MS> Am Mittwoch, den 12.11.2008, 22:55 +0200 schrieb KES:
>> Здравствуйте, Marc.
>> 
>> Вы писали 12 ноября 2008 г., 22:13:32:
>> 
>> MS> Another observation:
>> 
>> MS> In any case you get the error message:
>> 
>> >> function FNTEST2 is not defined
>> >> module name or entrypoint could not be found
>> 
>> MS> If the function name is there and written correctly, make sure the
>> MS> module (= your library) is found. I'm not used to making UDFs, but
>> MS> somehow the search path and maybe the libraries found there can be
>> MS> listed similar to using "ldconfig -r" but for the firebird stuff.
>> 
>> MS> Marc
>> 
>> "C" programm 'testudf.c' I have compiled with gcc works fine. Firebird see it and
>> I can call 'fntest' function
>> 
>> When I compile my 'tkes.pp'. Firebird do not found function I need.
>> 
>> In both cases (C, FPC) libs are located in
>> /usr/local/libexec/firebird/udf directory and have same premissions
>> 
>> also I have tryed to test my libtkes2.so.
>> 
>> I write test.pp
>> {$linklib libtkes2.so}
>> 
>> function somefn(): integer; stdcall; external 'libtkes2' name 'somefn';

MS> Will stdcall default to cdecl?

I have tryied as sdecl as stdcall, results are same =(

>> begin
>>   Writeln( somefn() );
>> end.
>> 
>> in this case dynamic library are located and somefn is called
>> 
>> This seems that Firebird does not understand .so module compiled by
>> FPC
>> 
>> also I have tryed this:
>> fpc -Cn tkes2.pp
>> gcc tkes2.o -o libtkes2.so -shared
>> in this case Firebird also does not see somefn:
>> DETAILS:
>> libtkes2.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped

MS> Then I'd say the fault is clearly on the firebird side.

MS> One last thing I'd try is to use another name (like with ld: using
MS> -lmine is searching for "libmine.so", not only "mine.so"), if that
MS> fails, too, it time for one of fpc's developers to comment or the
MS> firebird people to investigate.

what do you mean?

MS> Marc





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




More information about the fpc-pascal mailing list