Re: C++ global constructors in xsub?



usenet.zaa.jabberwock@xxxxxxxxxxxx wrote:
Thanks for your reply.  However, I'm not sure if your example requires
global constructors (I'm not well experienced with C++, so I'm not
exactly sure what constructs require this; static members maybe?).
What I'm referring to by "global constructors" is code that gets run by
__do_global_ctors() when the program starts up.
Sorry, but what is __do_global_ctors()? Is this a Perl function?
Or does this function call a constructor of the C++ class?


The library I'm writing the xsub for is a 3rd party library, so I don't have access to the souce or anything. However, I'm pretty sure this is the problem. It works fine with LINKTYPE=static, and in the debugger I can actually see it call the library from __do_global_ctors(). With a dynamic build, it first calls the library when I call one of the xsub functions, and dies with a bus error or memory error.
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.


regards, Reinhard .



Relevant Pages

  • Re: C++ global constructors in xsub?
    ... What I'm referring to by "global constructors" is code that gets run by ... The library I'm writing the xsub for is a 3rd party library, ... and dies with a bus error or memory error. ...
    (comp.lang.perl.modules)
  • Re: C++ global constructors in xsub?
    ... global constructors (I'm not well experienced with C++, so I'm not exactly sure what constructs require this; static members maybe?). ... The library I'm writing the xsub for is a 3rd party library, ... and dies with a bus error or memory error. ...
    (comp.lang.perl.modules)