[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why won't this extension load?

From: Stephen Compall
Subject: Re: Why won't this extension load?
Date: Tue, 13 Dec 2005 11:47:30 -0600

On Tue, 2005-12-13 at 09:01 -0700, Steve Juranich wrote:
> I've got a simple little C++ file (please try to ignore the bad style
> as it's not relevant to the problem at hand) that goes like this:
> <code name="">
> void scm_init_test() {
> standard input:1:1: In procedure dynamic-func in expression
> (load-extension "libtest" "scm_init_test"):
> standard input:1:1: ./ undefined symbol: scm_init_test
> I'm totally willing to accept the fact that my module has bugs, but
> I'm not even getting out of the gate on this one and I'm not sure why.
>  It sure looks to me (and to nm) like the symbol in question is
> defined.

Strictly speaking, the symbol "scm_init_test" hasn't been defined, some
wacko symbol like _Nqhtjhwq_scm_init_test has been defined [well, maybe
not that bad for a function with no return value and no arguments].
Regardless, the name has been mangled by the C++ compiler, which is why
you pass the -C option to `nm', which demangles names.  The solution is
to say:

extern "C"
void scm_init_test....

Stephen Compall

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]