Re: C++ global constructors in xsub?



> Sorry, but what is __do_global_ctors()? Is this a Perl function?
> Or does this function call a constructor of the C++ class?

__do_global_ctors() may be a g++-specific name. I don't have enough
experience in this stuff to know. But my understanding is that a C++
program (almost?) always has a function that gets run before main() to
initialize static objects (one site said that it's required by the C++
standard to run before main(); another said that it can be deferred
until the object is accessed). My problem is apparently that this
isn't getting called when I use dynamic loading. I don't know if this
is supposed to be handled by DynaLoader, or if this situation simply
can't be handled by Perl.

> Can you post some code snippet? I do not understand what you actually
> want to do. But try to ask in perl.xs (nntp.perl.org) the people in
this
> group a very expirenced.

I could, but I don't think it will help. My XS code is pretty
standard. It's what's going on in the library (which I don't have any
visibility into) that's the problem. Like I said, it works fine when
it's statically linked.

Thanks for the perl.xs pointer. I'll try there.
--
JAB

.



Relevant Pages