Re: C++ again Baggett/DOOMer on Mon, Mar 09, 1998 at 12:21:50AM -0600

From: Eric Green (ejg3@CORNELL.EDU)
Date: 03/09/98


On Mon, Mar 09, 1998 at 12:21:50AM -0600, Akuma/Chris Baggett/DOOMer wrote:
> At 10:13 PM 3/8/98 -0700, you wrote:
> >G++ mangles function names.  You need to either make the functions C
> >functions (extern "C") or provide mangled names in your table.  You can
> >use "nm <object file name>" to get the mangled names.  They'll look
> >something like "postmaster__FP9char_dataPviPcT3".  My specials table is
> >something like:
> >
> >#define PROC_ENTRY(proc)        { #proc, #proc "__FP9char_dataPviPcT3",
> NULL }
> >
>
> couldn't you just name the file from  whatever.c  to  whatever.cpp or
> whatever.c++ ??
> it works for me, and all my functions are fine.

As far as g++ goes, the file naming makes no difference to the generated
object files.  Perhaps there is an option to g++ to mangle names in a
different way, but with the standard options, there is no "postmaster"
symbol in the generated dynamically loadable library, so linux's libdl 1.9
can't load the symbol "postmaster".  Other options, compilers, libdl's,
and binutils might produce other results.

Eric


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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