Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: embedding Perl into C for Windows

by Anonymous Monk
on Feb 11, 2014 at 21:23 UTC ( #1074511=note: print w/ replies, xml ) Need Help??


in reply to embedding Perl into C for Windows

Where does it crash? Can perl find power.pl?

Looks like you don't have  PERL_SYS_INIT3(&argc,&argv,&env); from http://perldoc.perl.org/perlembed.html#Fiddling-with-the-Perl-stack-from-your-C-program

That might be responsible for not finding power.pl

That example worked for me in 2011 :)


Comment on Re: embedding Perl into C for Windows
Download Code
Re^2: embedding Perl into C for Windows
by bulk88 (Priest) on Feb 12, 2014 at 01:38 UTC
    Ditto on PERL_SYS_INIT3(&argc,&argv,&env);. It does nothing on no-threads Unix, but it mandatory on windows to setup process global (not interp/ithread global) data. Im not sure if it does something on ithreads unix.
      Hello bulk88, this was the missing link:
      PERL_SYS_INIT3(&argc,&argv,&env); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; PERL_SYS_TERM();
      I added these three commands - now it works! Many, many thanks - great! Greeting from Germany Frank
Re^2: embedding Perl into C for Windows
by ccad (Novice) on Feb 12, 2014 at 07:28 UTC
    Hello anonymous monk, thanks for your answer. The solution was:
    PERL_SYS_INIT3(&argc,&argv,&env); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; PERL_SYS_TERM();
    I added these three commands - now it works! Frank

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1074511]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-04-20 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls