in reply to Embedding Perl Interpreter/DynaLoader

Thank you all again for the help, Per the suggestion, I removed the '-L' from the DynaLoader.a chunk, and things compiled fine. Whew!

The compile string is now:

cc '-Wl,-E' -I "/usr/local/include" -I "/opt/perl/lib/5.6.1/PA-RISC1.1 +-thread-multi/CORE" -o codeGen xsinit.c codeGen. c -L/usr/local/lib -L "/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi/COR +E" "/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi/auto/DynaLoa der/DynaLoader.a" -lperl -lnsl -lm -lc -lcrypt -lsec -L/usr/local/lib
Unfortunately, when I run the executable I still get that same ol' frustrating error:
Can't load module File::Glob, dynamic loading not available in this pe +rl. (You may need to build a new perl executable which either supports dynamic loading or has the File::Glob module statically linked into +it.) Compilation failed in require at search.pl line 8. BEGIN failed--compilation aborted at search.pl line 8. Undefined subroutine &main::search_files called at search.pl line 8.
And, of course, things are lovely if I remove any reference to glob(). Beyond this point, I'm not sure how to create an executable that "supports dynamic loading". Hmmm, perhaps naively I thought DynaLoader.a would do that. Perhaps - if there are no more obvious things for me to try - I will make do w/o glob() as part of my embedded Perl.

Thank you all,

MatthewFrancis

Replies are listed 'Best First'.
Re: Re: Embedding Perl Interpreter/DynaLoader
by mpeppler (Vicar) on Dec 02, 2003 at 00:11 UTC
    OK - now the problem is that the libperl.so/.a is from a build that does not include the dl_open.xs (or whichever implementation is used under HP-UX) module.

    Is the C compiler you are using the basic C compiler that comes with HP-UX?

    I have a feeling that if that's the case then that C compiler is an old K&R compiler that can't be used to build dynamically loadable modules, etc. Maybe it'd be worth it to download/install gcc? I think there is a site that offers binaries, similar to sunfreeware for Solaris.

    Michael

      Interesting. I've heard of these ".so" files before, but we don't have any on our server. All we've got is the libperl.a. Does this mean that our current Perl installation is broken/incomplete? If so, I am going to see what I can do about having our Perl reinstalled. For what it's worth, we're using (courtesy of of "perl -v"):
      Binary build 633 provided by ActiveState Corp. http://www.ActiveState. +com Built 21:04:57 Jun 17 2002
      If it's a binary build, then, perhaps the .so file was never there to begin with. Would you recommend actually building it ourselves, as opposed to working with a precompiled binary?

      Yes, I believe the compiler is the standard, no-frills HP-UX compiler.

      And - please forgive the remedial nature of my questions - how can I statically link the File::Glob module into my perl executable? What do I have to provide at the command line in order to make this happen?

      Thank you again, for the help

      MatthewFrancis

        Actually you probably have .sl files instead (that's the shared library extension on HP-UX, IIRC).

        I don't think that the ActiveState binary is incomplete - but I'm almost certain that you'll need gcc or some other modern compiler to build any binary for use with perl. I would start by installing gcc, and see if that solves your problems.

        Michael