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

Hi guys,

I'm new to perl so please be gentel ;-)

In any case I installed strewberry perl on my system and have successfully installed a number of modules. However when trying to install Net-RawIP-0.25 I got the message I neede the Pcap libraries.

So I progressed by downloading the winPcap developer pack and downloaded the Net-Pcap-0.16 module.

When doing the initial perl Makefile.pl it seems to go well:

C:\>perl Makefile.PL INC=-IC:/WpdPack/Include "LIBS=-LC:/WpdPack/Lib -lwpcap" socket.h patched... ok looking for -lwpcap... yes checking for pcap_lib_version() in -lwpcap... yes detecting available functions... ok Writing Makefile for Net::Pcap

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

however when I then run the dmake command I start getting errors:

C:\>dmake Skip blib\lib\Net\Pcap.pm (unchanged) gcc -c -IC:/WpdPack/Include -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT _CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.16\" -DXS_VERSION=\"0.16\" "-IC:\strawberry\perl\lib\CORE" -DWINSOCK2_H_REQUESTED -DWPCAP -DHAVE_REMOTE -DHAVE_BLANK -DHAVE_PCAP_LIB_VERSIO N Pcap.c In file included from Pcap.xs:43: stubs.inc:85:2: warning: #warning "the function pcap_findalldevs() is not availa ble, but will be emulated" In file included from Pcap.xs:43: stubs.inc:90: error: redefinition of typedef 'pcap_if_t' C:/WpdPack/Include/pcap.h:89: error: previous declaration of 'pcap_if_t' was her e stubs.inc:91: error: redefinition of `struct pcap_if' stubs.inc:113:2: warning: #warning "the function pcap_breakloop() is not availab le" stubs.inc:127:2: warning: #warning "the function pcap_setnonblock() is not avail able" stubs.inc:142:2: warning: #warning "the function pcap_getnonblock() is not avail able" stubs.inc:157:2: warning: #warning "the function pcap_dump_file() is not availab le" stubs.inc:172:2: warning: #warning "the function pcap_dump_flush() is not availa ble" stubs.inc:187:2: warning: #warning "the function pcap_list_datalinks() is not av ailable" stubs.inc:202:2: warning: #warning "the function pcap_set_datalink() is not avai lable" stubs.inc:217:2: warning: #warning "the function pcap_datalink_name_to_val() is not available" stubs.inc:232:2: warning: #warning "the function pcap_datalink_val_to_name() is not available" stubs.inc:247:2: warning: #warning "the function pcap_datalink_val_to_descriptio n() is not available" stubs.inc:262:2: warning: #warning "the function pcap_compile_nopcap() is not av ailable" stubs.inc:277:2: warning: #warning "the function pcap_get_selectable_fd() is not available" stubs.inc:292:2: warning: #warning "the function pcap_next_ex() is not available " stubs.inc:307:2: warning: #warning "the function pcap_sendpacket() is not availa ble" stubs.inc:322:2: warning: #warning "the function pcap_createsrcstr() is not avai lable" stubs.inc:337:2: warning: #warning "the function pcap_parsesrcstr() is not avail able" stubs.inc:352:2: warning: #warning "the function pcap_open() is not available" stubs.inc:357: error: redefinition of `struct pcap_rmtauth' stubs.inc:373:2: warning: #warning "the function pcap_setbuff() is not available " stubs.inc:388:2: warning: #warning "the function pcap_setuserbuffer() is not ava ilable" stubs.inc:403:2: warning: #warning "the function pcap_setmode() is not available " stubs.inc:418:2: warning: #warning "the function pcap_setmintocopy() is not avai lable" stubs.inc:433:2: warning: #warning "the function pcap_sendqueue_alloc() is not a vailable" stubs.inc:438: error: redefinition of `struct pcap_send_queue' stubs.inc:444: error: redefinition of typedef 'pcap_send_queue' C:/WpdPack/Include/Win32-Extensions.h:53: error: previous declaration of 'pcap_s end_queue' was here stubs.inc:455:2: warning: #warning "the function pcap_sendqueue_destroy() is not available" stubs.inc:469:2: warning: #warning "the function pcap_sendqueue_queue() is not a vailable" stubs.inc:484:2: warning: #warning "the function pcap_sendqueue_transmit() is no t available" stubs.inc:499:2: warning: #warning "the function pcap_event() is not available" stubs.inc:514:2: warning: #warning "the function pcap_setsampling() is not avail able" stubs.inc:519: error: redefinition of `struct pcap_samp' dmake: Error code 129, while making 'Pcap.o'

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

Any help would be greatly appreciated on getting this to work.

Thanks,

Tom

  • Comment on problem installing Net-RawIP-0.25 in strawberry perl

Replies are listed 'Best First'.
Re: problem installing Net-RawIP-0.25 in strawberry perl
by Tom Decaluwe (Initiate) on Aug 07, 2009 at 11:48 UTC

    I have done some more lookup and found the great feature of installing over the net + dependancies.

    "perl -MCPAN -e "install Net::Pcap""

    This seems to work great for most modules but i'm still getting the error with the Pcap one

    checking for pcap_lib_version() in -lwpcap... no

    Any ideas on what the default location should be for pcap_lib and how i can get this module to install?

    Thanks, Tom

      Hi,
      Does Net::RawIP need Net::Pcap ? If so, there is a Net::Pcap ppm package you should be able to use. Just run (while connected to the internet):
      ppm install http://www.bribes.org/perl/ppm/Net-Pcap.ppd
      You might also want to read these notes, though I think you've got that part of it covered.

      However, while the libpcap library is needed for Net::RawIP, I don't think Net::Pcap is needed - it's not listed as a pre-requisite in the Net::RawIP Makefile.PL. The bad news is that no-one seems to have yet built Net::RawIP for Windows, which would suggest that it might not be such a trivial task.

      What happens if, having installed WinPcap, you forget about trying to build Net::Pcap, and try to build Net::RawIP ?

      Also, which version of Strawberry Perl do you have ? Running perl -v will tell you.

      Cheers,
      Rob
        Hi Rob,

        Thanks for the reply, but up untill now no joy :-(

        I ran the ppm install http://www.bribes.org/perl/ppm/Net-Pcap.ppd => this command seems to have run just fine.

        However wehn i now try ot run the RapIP setup i still get:

        C:\Users\tomd\Desktop\perl\Net-RawIP-0.25\Net-RawIP-0.25>perl -MCPAN -e "in stall Net::RawIP" Database was generated on Tue, 11 Aug 2009 13:34:20 GMT Running install for module 'Net::RawIP' Running make for S/SA/SAPER/Net-RawIP-0.25.tar.gz Checksum for C:\strawberry\cpan\sources\authors\id\S\SA\SAPER\Net-RawIP-0.25.tar .gz ok CPAN.pm: Going to build S/SA/SAPER/Net-RawIP-0.25.tar.gz Use of uninitialized value in concatenation (.) or string at Makefile.PL line 52 . Use of uninitialized value in print at Makefile.PL line 54. Use of uninitialized value in eval "string" at Makefile.PL line 55. Compiler: gcc gcc (GCC) 3.4.5 (mingw-vista special r3) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Could not load the pcap library. Please see the README file on how to install it. Be sure to also install the C headers (pcap.h). Warning: No success on commandC:\strawberry\perl\bin\perl.exe Makefile.PL SAPER/Net-RawIP-0.25.tar.gz C:\strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install

        My version of perl is:

        C:\Users\tomd\Desktop\perl\Net-RawIP-0.25\Net-RawIP-0.25>perl -v This is perl, v5.10.0 built for MSWin32-x86-multi-thread Copyright 1987-2007, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.

        Any advice is much appreciated.

        Tom