[fpc-pascal] [HOW TO] Create a shared object (SO) with FP

Jilani Khaldi jilani at cheapnet.it
Sat Apr 23 00:59:17 CEST 2011


On 22/04/2011 22.36, Sven Barth wrote:
> On 22.04.2011 18:31, Jilani Khaldi wrote:
>> {$linklib c}
>>
>> uses
>> dynlibs;
>>
>> procedure hello(const x: double); cdecl; external 'libmylib.so';
>>
>> var
>> lHandle: TLibHandle;
>> v: double;
>> begin
>> lHandle := LoadLibrary('./libmylib.so');
>> if lHandle <> nilHandle then
>> begin
>> v := 3.14159;
>> hello(v);
>> end else
>> writeln('Cannot load "mylib.so"')
That's ok. It works now as expected.
Thank you :-)

-- 
Jilani KHALDI
---------------------
** Architectura Vindex
http://www.vindexa.org




More information about the fpc-pascal mailing list