munu has asked for the wisdom of the Perl Monks concerning the following question:

I am using perlcc command to generate an ".o" file.

In my program I am using following modules and all modules are installed successfully on my pc because
"$ perl myprogram.pl" works fine...

Net::Pcap
NetPacket::TCP
NetPacket::UDP
Net::RawIP
Socket

I have used following command "$ perlcc myprogram.pl"

But I am getting following errors/messeges:
/tmp/ccW3W1bz.o:In function 'dl_init':
/tmp/ccW3W1bz.o(.text+0xa8944): undefined reference to 'boot_net__Pcap'
/tmp/ccW3W1bz.o(.text+0xa89fa): undefined reference to 'boot_net__RawIP'
/tmp/ccW3W1bz.o(.text+0xa8ab0): undefined reference to 'boot_Socket'
collect2: ld returned 1 exit status

Can You plz help me to make this work...

Thanks
MUNU
update: I have tried "$ perlcc myprogram.pl -L /usr/lib/perl5/site_perl/5.6.1/i386-linux/Net/"
here Pcap.pm and RawIP.pm are present.
but it is still not working..

Replies are listed 'Best First'.
Re: problem with using "perlcc" command.
by waswas-fng (Curate) on Jul 29, 2004 at 16:40 UTC
    from the perlcc docs: The code generated in this way is not guaranteed to work. The whole codegen suite (perlcc included) should be considered very experimental. Use for production purposes is strongly discouraged.

    You might want to take a look at PAR.


    -Waswas
Re: problem with using "perlcc" command.
by iburrell (Chaplain) on Jul 29, 2004 at 18:10 UTC
    perlcc is experimental, not supported, and not under active development. My impression is that it is not usable for production purposes.

    PAR, which packages the Perl modules, libraries, and interpreter into an executable is a better solution. It does not compile the bytecode but does solve the problem of producing a single file that can be distributed.

      I have tried with PAR(pp) also.
      for ex.
      pp -o a a.pl
      pp -o a.exe a.pl

      but i can not run the executables ("$ ./a" in linux or "c:/a.exe" in WIN2K)
      error messege "bash :./a can not execute binary file" comes in case of linux.
      and "file is too big to be fitted in memory" error messege comes in windows.

      MUNU