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.

Thanks for the h2pas hint.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to