[lazarus] The use of FPC and Lazarus for simulation software

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Sep 23 03:14:26 EDT 2003

On Mon, 22 Sep 2003, P. van der Velde wrote:

> Michael.VanCanneyt at Wisa.be wrote:
> >On Fri, 19 Sep 2003, P. van der Velde wrote:
> >
> >
> >
> >>Now I had some questions with regards to the possibilities of FPC and
> >>Lazarus. If these are way off topic please let me know and I'll take my
> >>questions elsewhere.
> >>First I would like to know if it is possible to do dynamic package
> >>loading in Lazarus and FPC. I know static package loading is possible
> >>(loading a package at compile time). However I really want to do dynamic
> >>loading for my project. As far as I know this is not (yet) possible in
> >>FPC or am I wrong here? If it is not available any idea on how long it
> >>will take before it will be available or if it will be available at all?
> >>
> >>
> >
> >It depends. There is limited support for writing dynamical libraries,
> >on Linux. Libraries on Win32 work just fine. Loading external libraries
> >works OK on both platforms.
> >
> >But there is nothing yet in the line of the package system as it exists in
> >Delphi. This is not likely to appear in the nearest year.
> >
> Ok that is to bad. Any idea on when it will be available?

No. Like I said, definitely not in the nearest year.

> To give you an idea why I think I need dynamic package loading I will
> quickly explain the idea. The base idea of my research is that I will
> develop an application which contains basic knowledge about the
> components it controls (compiled with the application are a number of
> abstract base classes which form the base for the components). To allow
> a developer to use the application without having to recompile if he
> develops a new component I thought that it would be best if these new
> components (a collection of classes) would be stored in a package. The
> application can then dynamically load the package, locate the different
> classes and use them. All without recompiling etc.
> Now can I also do this with normal external libraries  (i.e. store
> classes in them and extract these for use)? And how could I achieve this.

I think you can do this by using interfaces.
This kind of problems is why they were invented, I suppose.

All you need is a registration routine which is exported by your
library, and a routine which creates a requested class/interface.

It shouldn't be that hard. The only caveat will be that IS and AS
operators won't work correctly as the VMTs will be different.


More information about the Lazarus mailing list