theo schrieb:
> 
>> How would the easy way be?
>>
> 
> I've just been looking into some old Kylix sources:
> 
> interface
> const LibName = '';
> function XftDrawCreate(display: PDisplay; win: XID; vis: PVisual;
> colorm: longint): PXftDraw; cdecl;
> 
> implementation
> function XftDrawCreate(display: PDisplay; win: XID; vis: PVisual;
> colorm: longint): PXftDraw; cdecl; external LibName;
> 
> initialization
> if dlopen('libXft.so', RTLD_LAZY or RTLD_GLOBAL) = nil then
> 
> I can't remember if the extra declaration in the interface section was
> necessary.
> But by simply settting Libname to empty string and using dlopen I could
> switch from static do dynamic afair.

Yes, this was possible with Kylix, however, it requires the usage of PIC
also inside the caller.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to