[fpc-devel]dinamic/shared library

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Oct 24 17:03:16 CEST 2000


On Tue, 24 Oct 2000, Michail A.Baikov wrote:

> LoadLibrary, FreeLibrary, GetProcAddr.
> 
> RTFM please.

Michail,

your answer is incomplete:

In the development version, FPC has a unit called dynlibs.
This unit has an OS independent interface for loading libraries:

Function LoadLibrary(Name : AnsiString) : TLibHandle;
Function GetProcedureAddress(Lib : TlibHandle; ProcName : AnsiString) : Pointer;
Function UnloadLibrary(Lib : TLibHandle) : Boolean;

The unit can be compiled with the 1.0 release, just download the
sources of the development RTL and copy&compile the relevant sources:

dynlibs.pp   in the rtl/inc directory
dynlibs.inc  in the rtl/OS directory (replace OS with linux, OS2 or Win32)

The unit should compile out of the box.

So before answering with RTFM,
you must be 100% sure about what you say :-)

Michael.





More information about the fpc-devel mailing list