[fpc-devel]Exporting variables in libraries for Linux / FreeBSD
Marco van de Voort
marcov at stack.nl
Sat Feb 15 14:07:13 CET 2003
> > >it will compile on Win32, but just refuse to compile on Linux. When you
> > >search on the error the compiler generates, you'll find the docs that
> > >explain that exporting of variables is only supported on Win32.
> >
> > Under linux it is not supported because linux works different with shared
> > libraries. For procedures we could add an extra jmp with the new name. But
> > for variables it's not possible as for the imported variables it is not
> > know if they need an extra derefence (that is what WIn32 is using for dll
> > variables) or that they need to be imported bij the dynamic linker.
> I see. Is there any chance of getting this feature implemented, or would it
> be better to try to write a library in C that in turn uses my library in FPC
> to provide the functionality that it should?
I wouldn't do that. I'd make getters and setters (functions and procedures
wrappers to read/write vars) to access them. These even can get handy later
to get things threadsafe.
More information about the fpc-devel
mailing list