Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Net::Pcap installation help (and not with the library)

by taapm (Initiate)
on Apr 25, 2013 at 05:25 UTC ( [id://1030585]=note: print w/replies, xml ) Need Help??


in reply to Re: Net::Pcap installation help (and not with the library)
in thread Net::Pcap installation help (and not with the library)

Hi, I'm getting an error at step 5 doing 'dmake test'.

The x64 libraries did not exist so I did have to do step 4.

First, my setup:

Win 7 64bit

Strawberry Perl v5.16.3 built for MSWin32-x64-multi-thread installed at D:\strawberry

Net-Pcap-0.17

WinPcap v4.1.3

WpdPack v4.1.2

Patches 2-5 were applied.

'perl -V:cc' gives: cc='gcc';

'perl -V:make' gives: make='dmake';

Windows PATH:

PATH=C:\Program Files\ImageMagick-6.8.0-Q16;C:\Program Files (x86)\AMD + APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\sys +tem32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Windows +PowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core +-Static;c:\program files\oracle\virtualbox;c:\utils;D:\strawberry\c\b +in;D:\strawberry\perl\site\bin;D:\strawberry\perl\bin
and the results for 'dmake test':
D:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib\lib', 'blib\arch')" t/*.t # Testing Net::Pcap 0.17 (WinPcap version 4.1.3 (packet.dll version 4. +1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008)) +under Perl 5.016003 t/00-load.t ................ ok t/01-api.t ................. ok t/02-lookup.t .............. ok t/03-openlive.t ............ skipped: must be run as root t/04-loop.t ................ skipped: must be run as root t/05-dump.t ................ skipped: must be run as root t/06-offline.t ............. skipped: must be run as root t/07-stats.t ............... skipped: must be run as root t/08-filter.t .............. ok t/09-error.t ............... ok t/10-fileno.t .............. ok t/11-snapshot.t ............ skipped: must be run as root t/12-next.t ................ skipped: pcap_next() behaves too strangel +y for being tested on random machines t/13-dispatch.t ............ skipped: must be run as root t/14-datalink.t ............ ok # This platform has been detected as a little endian architecture t/15-is_swapped.t .......... ok t/16-setnonblock.t ......... ok # WinPcap version 4.1.3 (packet.dll version 4.1.0.2980), based on libp +cap version 1.0 branch 1_0_rel0b (20091008) t/17-lib_version.t ......... ok t/18-open_dead.t ........... ok t/19-breakloop.t ........... skipped: must be run as root t/20-constants.t ........... ok t/21-next_ex.t ............. skipped: slowness and random failures... +testing pcap_next_ex() is a PITA # Failed test 'calling setbuff() with no argument' # at t/22-open.t line 46. # expecting: /^arg1 not a reference/ # found: p is not of type pcap_tPtr at t/22-open.t line 45. # Failed test 'calling userbuffer() with no argument' # at t/22-open.t line 52. # expecting: /^Usage: Net::Pcap::setbuff\(p, size\)/ # found: userbuffer is not a valid pcap macro at t/22-open.t line 51. # Failed test 'calling userbuffer() with no argument' # at t/22-open.t line 57. # expecting: /^arg1 not a reference/ # found: userbuffer is not a valid pcap macro at t/22-open.t line 56. # Failed test 'calling setmode() with no argument' # at t/22-open.t line 68. # expecting: /^arg1 not a reference/ # found: p is not of type pcap_tPtr at t/22-open.t line 67. # Failed test 'calling setmintocopy() with no argument' # at t/22-open.t line 79. # expecting: /^arg1 not a reference/ # found: p is not of type pcap_tPtr at t/22-open.t line 78. # Looks like you failed 5 tests of 24. t/22-open.t ................ Dubious, test returned 5 (wstat 1280, 0x500) Failed 5/24 subtests (less 13 skipped subtests: 6 okay) # Failed test 'calling createsrcstr() with incorrect argument type f +or arg6' # at t/23-srcstr.t line 33. # expecting: /^arg6 not a hash ref/ # found: arg6 not a reference at t/23-srcstr.t line 32. # Failed test 'createsrcstr() ' # at t/23-srcstr.t line 70. # got: 'Undefined subroutine &main::createsrcstr called at t/ +23-srcstr.t line 69. # ' # expected: '' # Failed test ' - should return zero: ' # at t/23-srcstr.t line 71. # got: undef # expected: '0' # Failed test ' - checking created source string' # at t/23-srcstr.t line 72. # got: '' # expected: 'rpcap://fangorn:12345/eth0' # Failed test 'parsesrcstr() ' # at t/23-srcstr.t line 76. # got: 'Undefined subroutine &main::parsesrcstr called at t/2 +3-srcstr.t line 75. # ' # expected: '' # Failed test ' - should return zero: ' # at t/23-srcstr.t line 77. # got: undef # expected: '0' # Failed test ' - checking parsed type' # at t/23-srcstr.t line 78. # got: '' # expected: 'rpcap' # Failed test ' - checking parsed host' # at t/23-srcstr.t line 79. # got: '' # expected: 'fangorn' # Failed test ' - checking parsed port' # at t/23-srcstr.t line 80. # got: '' # expected: '12345' # Failed test ' - checking parsed name' # at t/23-srcstr.t line 81. # got: '' # expected: 'eth0' # Looks like you failed 10 tests of 18. t/23-srcstr.t .............. Dubious, test returned 10 (wstat 2560, 0xa00) Failed 10/18 subtests t/50-poe-component-pcap.t .. skipped: POE is not available t/distchk.t ................ skipped: Test::Distribution required for +checking distribution t/pod.t .................... skipped: Test::Pod 1.14 required for test +ing POD t/podcover.t ............... skipped: Currently not working for Net::P +cap t/podspell.t ............... skipped: Pod spelling: for maintainer onl +y t/portfs.t ................. skipped: Only for the module maintainer Test Summary Report ------------------- t/10-fileno.t (Wstat: 0 Tests: 21 Failed: 0) TODO passed: 19 t/22-open.t (Wstat: 1280 Tests: 24 Failed: 5) Failed tests: 5-7, 9, 11 Non-zero exit status: 5 t/23-srcstr.t (Wstat: 2560 Tests: 18 Failed: 10) Failed tests: 3, 10-18 Non-zero exit status: 10 Files=30, Tests=521, 5 wallclock secs ( 0.14 usr + 0.03 sys = 0.17 +CPU) Result: FAIL Failed 2/30 test programs. 15/521 subtests failed. dmake: Error code 255, while making 'test_dynamic'

Replies are listed 'Best First'.
Re^3: Net::Pcap installation help (and not with the library)
by VinsWorldcom (Prior) on Apr 25, 2013 at 11:47 UTC

    You will get some test failures - I don't remember quite that many. But proceed with the process and create and run the test script in the install directory. Run it with 'perl -Mblib test.pl' from the install directory. If that runs fine, then do the 'dmake install'.

      Thanks for the prompt reply. Here's what happens when I try to run the test script:
      D:\strawberry\Net-Pcap-0.17>perl -Mblib test.pl Undefined subroutine &main::pcap_findalldevs called at test.pl line 3

        I don't know if it matters, but I have different versions:

        Win7 x64

        Strawberry Perl 5.16.1

        Net::Pcap = 0.16

        WinPcap = 4.1.2

        The patches mentioned were written against Net::Pcap 0.16, not sure how the update to 0.17 will effect them?

        Also, not sure how using WinPcap 4.1.3 with the headers / libraries (WpdPack) for 4.1.2 will effect compile and run?

        UPDATE: The patches definitely don't work by just running 'patch' on the Net::Pcap 0.17 version as the Makefile.PL has some additional lines throwing off the patch files. However, looking at the patches and manually adding them worked fine for me.

        I did get a compilation error at first about "undefined reference to `pcap_..." but that was resolved by simply recreating the x64 libraries according to step 4 of the process above.

        The test.pl file also didn't work - gave an "Undefined subroutine &main::pcap_findalldevs called at test.pl line 3". It seems the 0.17 version of Net::Pcap handles the ':functions' export tag differently. This is resolved with a new test.pl as follows:

        use Net::Pcap; @devs = Net::Pcap::pcap_findalldevs(\%devinfo, \$err); for my $dev (@devs) { print "$dev : $devinfo{$dev}\n" }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found