Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: perl in C >>> "dynamic loading not available in this perl."

by Anonymous Monk
on Jan 13, 2006 at 06:13 UTC ( [id://522907]=note: print w/replies, xml ) Need Help??


in reply to perl in C >>> "dynamic loading not available in this perl."

Sorry,I also encounted this question and I used the way which Courage had offered. But,I still can't pass my program and the question still remained. Could anyone answer the question? 3Q.
  • Comment on Re: perl in C >>> "dynamic loading not available in this perl."

Replies are listed 'Best First'.
Re^2: perl in C >>> "dynamic loading not available in this perl."
by Anonymous Monk on Jan 13, 2006 at 07:48 UTC
    If the error is the same, you need to try again. The only way is to recompile perl with support for dynamic loading.

      I got it.

      Last friday,I passed my program.Now I will share my solution.

      1---->perl_parse(my_perl, NULL, argc, my_argv, NULL); 2----> perl -MExtUtils::Embed -e xsinit -- -o perlxsi.c cc -c perlxsi.c `perl -MExtUtils::Embed -e ccopts`

      Then perlxsi.c document has created.The file is:

      --------------------------------

      static void xs_init (pTHX); EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); EXTERN_C void boot_Socket (pTHX_ CV* cv); EXTERN_C void xs_init(pTHX) { char *file = __FILE__; /* DynaLoader is a special case */ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); newXS("Socket::bootstrap", boot_Socket, file); }

      ------------------------------

      That's where the glue code can be inserted to create the initial contact between Perl and linked C/C++ routines. Let's take a look some pieces of perlmain.c to see how Perl does this:

      Once you have this code, slap it into the second argument of perl_parse():

      3----->perl_parse(my_perl, xs_init, argc, my_argv, NULL); and the file interp.c must include "perlxsi.c"; 4-----> cc -o interp interp.c `perl -MExtUtils::Embed -e ccopts -e ldo +pts` interp

      I wish it could help somebody.

      If you want to connect with me ,this is my email:

      shengzongxian@gmail.com

      Edited by planetscape - added code tags

        Hello,
        Just wanted to say thanks.Your solution helped me.
        Thanks again for sharing it :)
        Regards,
        MM.
        perldoc perlembed

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (8)
As of 2024-04-19 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found