CPAN installing Net::Pcap and Packet module failed due to lpcap

后端 未结 3 421
臣服心动
臣服心动 2020-12-22 12:26

Recently, I tried to install perl module Net::Packet and Net::Pcap through cpan but it complained that it cannot find pcap library. So I was searching if cpan would accept e

相关标签:
3条回答
  • 2020-12-22 12:46

    On Ubuntu, just install libnet-pcap-perl.

    0 讨论(0)
  • 2020-12-22 12:54

    This fixed my issue:

    yum -y install perl-Net-Pcap libpcap-devel
    
    0 讨论(0)
  • 2020-12-22 13:10

    The README file for Net::Pcap shows how to tell Makefile.PL where to find the pcap library:

    perl Makefile.PL INC=-I/opt/local/include/pcap LIBS='-L/opt/local/lib -lpcap'
    

    (I've inserted your paths into the example.)

    However, getting the cpan shell to pass those arguments to Makefile.PL is rather more complicated. You'd have to use the Distroprefs system and create a YAML file to supply the arguments. If you're not already familiar with Distroprefs, it'll probably be easier to just install Net::Pcap by hand.

    0 讨论(0)
提交回复
热议问题