由于lpcap,CPAN安装Net :: Pcap和Packet模块失败 [英] CPAN installing Net::Pcap and Packet module failed due to lpcap

查看:175
本文介绍了由于lpcap,CPAN安装Net :: Pcap和Packet模块失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我尝试通过cpan安装perl模块Net :: Packet和Net :: Pcap,但它抱怨找不到pcap库。所以我正在搜索cpan在安装模块时是否会接受外部lib / include目录,但是直到现在还没有运气。

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 external lib/include directory when installing module, but no luck til now.

looking for -lpcap... no
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You appear to lack the pcap(3) library. 

If it is installed in a non-standard locatio n, please try setting the LIBS 
and INC values on the command line.

Or get the sources and install the pcap library from http://www.tcpdump.org/

If you install the pcap library using a system package, make sure to also 
install the corresponding -devel package, which contains the C headers needed 
to compile this module. 
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

我的pcap库位于/ opt / local / lib,标头位于/ opt / local / include / pcap。
有人知道如何解决此问题吗?谢谢

my pcap library is located at /opt/local/lib and header at /opt/local/include/pcap. Anyone know how to solve this issue? Thanks

推荐答案

README 文件,用于 Net :: Pcap 显示了如何告诉Makefile.PL在哪里找到pcap库:

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将路径插入到示例中。)

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

但是,获取 cpan 外壳要复杂得多。您必须使用 Distroprefs 系统并创建一个YAML文件来提供论据。如果您还不熟悉Distroprefs,那么手动安装Net :: Pcap可能会更容易。

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.

这篇关于由于lpcap,CPAN安装Net :: Pcap和Packet模块失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆