[lazarus] Something like BPL files?

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Oct 14 05:21:20 EDT 2002


On Sat, 12 Oct 2002 18:22:06 -0500
"Tony Maro" <TonyM at nlisc.com> wrote:

> Back in Delphi 4 I was working on a huge game.  I made good use of .BPL files (similar to DLL's) that I could load and unload at runtime.  This enabled me to replace the game code while the game was running - but unlike a DLL, the BPL code had full access to object structures.  In fact, I was able to change the function of existing objects that were declared in a BPL that I was replacing.
> 
> I used this in a multiplayer RPG to facilitate upgrading the code without stopping the game.  It actually worked quite well.  I could get nonstop uptimes of weeks without fail, even while doing daily upgrades to the code.  I'd place a new version of the BPL - for instance the spells module - into a special location, log into the game as my superuser character, cast a special spell and the game would pause, unload the current spell module, move the new one into place and load it up.  Unlike a traditional MUD, I could actually create entirely new objects and load them into the game without kicking everyone out.
> 
> Is there a similar method with Lazarus / FPC?

I have only basic experiences with dynamic libs and fpc, but here are some points that can help:

You can use dynamic libs with fpc. There is a dynlibs.pp in the fpc1.1 cvs, which can also be used with 1.0.7.
Creating dynamic libs with object pascal support is very easy with the ppumove program. 
But fpc does not yet fully support it and so there are some drawbacks:
- You can't use typed consts
- You can't use ansistring constants
- Under windows you have to use a special heapmanager from borland.
- You have to convert _all_ used fpc libs (ppu files) into dynamic libs. 
  Under linux this is pretty easy.

There might be some other drawbacks, but these were enough for me to decide, that the Lazarus package system will have to wait for fpc. And this is also the case for packing the LCL into a lib.


Mattias






More information about the Lazarus mailing list