Re: shared libs in circle (was: C++ compiler warnings with dlsym())

From: Anil Mahajan (amahajan@PROXICOM.COM)
Date: 03/03/99

On Wed, 3 Mar 1999 11:04:01 -0500, Mark A. Heilpern <> wrote:

>I'm just curious to know what people have placed in
>shared libraries for CircleMUD? SpecProcs seems
>like an easy answer, but anything else?

   I currently have options to have special procedures and commands
in shared objects (I also have a 3rd module type which is a combined
type [can contain both commands and spec procs]).
   I plan on also putting skills and spells into modules too.

   Actually, one thing that might be nice in CircleMUD would be
to have a module api that anyone can code to.  For example, I could
code spec procs for my area, and then  give my area and my spec mods
to anyone with a circleMUD and they're just plug in.
   Or I'd code a new command, and there'd be no patch (unless you wanted
the code in the core functionality), but you could just plug it right
  I coded my shared objects with this in mind on FucMUD, but considering
how divergent that MUD is from standard circle, porting would prove
pretty difficulty for me.  I am however willing to share knowledge with
anyone who wants to make a patch... it takes a lot of work, I re-wrote
much of the command interpreter, and I had previously entirely re-written
the spec proc system.

>This thread got me reading the manual pages on the
>dlXXX() calls. Sounds interesting and there's even a nice,
>short example on how to use them. There isn't an
>example in the man pages for how to write the shared
>library though; should I just pick up source to a PAM
>module (they're small, simple dll's) to see how it's
>compiled, or is there a better example somewhere?
   Writing a shared library is no different from writing a normal
program.  The only difference is there is no 'linking' stage of the compile.
Also, you cannot have a main() function.
   The linking occurns runtime when you open the shared library (or
all at once when you open the shared library, depending on your open options).
You just need to be a bit more careful when write the things.
   You also need to compile it with the -shared and -rdynamic... hmm
and i also use -nostdlib for some reason, maybe that's just with that
set of plug-ins.  Dunno, i chose to do some funky makefile magic to make
compiling modules really easy... it makes my brain hurt to remember all
those wierd make options... :)

- Anil
  RoadKill@FucMUD 4000

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST