Re: C++ global constructors in xsub?



Hello John,

usenet.zaa.jabberwock@xxxxxxxxxxxx wrote:
Rather than bog this post down with my particular details, I'll just
ask the basic question:

Is it possible to write a dynamically-loaded xsub for a library that
has C++ global constructors?

I've googled this question to death and I haven't found a definite
answer one way or the other, although one post led me to believe that
building a new perl binary as described in CookbookB/CCsimple would
solve the problem.  It didn't, and I'm not sure how it could, but maybe
I'm missing something.

If I get a "yes", I'll follow up with the gory details of my problem.
But just so it's not completely open-ended, I'm running under HPUX
11.11, perl 5.8.6 (but I'd be willing to rebuild perl any way anyone
suggests).

I am not on HPUX but I can do it. (OS = Windwos XP, MSVC/C++ compiler)

test.xs
e.g:
class Test
{
	Test(void)
	{
		printf("Hello from class Test\n");
	}
};

Test testen;

But I putted it befor the MODULE/PACKAGE line.

Running the module I got printed
"Hello from class Test"


regards, Reinhard .



Relevant Pages

  • Re: finding perl info on google can be hard
    ... Perl is does, but perldoc -f seek didn't say so). ... | written into the gap). ... Many live that deserve death. ...
    (comp.lang.perl.misc)
  • Re: Seds N equivalent in Perl paragraph mode
    ... I want to remove this and next paragraph when criteria is met in this ... I tried the following in Perl, ... Many live that deserve death. ...
    (comp.lang.perl.misc)
  • RE: DBI Install
    ... this does indeed seem to be the case and I can't rebuild perl without jeopardizing our primary system ... Witzke, Rob wrote: ... you need a C compiler to install some modules. ... You need to build modules with the same compiler that Perl was built with. ...
    (perl.beginners)
  • Re: restructuring Perl installation
    ... > I want to restructure my Perl installation so it's a bit more ... This is usual on Unix systems. ... to rebuild perl if you want to change it. ...
    (comp.lang.perl.misc)
  • Re: PAR packer Error
    ... I am trying to make an exe file from a perl script file. ... ActiveState Perl 5.8.6 on Windows. ... Many live that deserve death. ...
    (comp.lang.perl.misc)