由于 lpcap,CPAN 安装 Net::Pcap 和 Packet 模块失败
最近,我尝试通过 cpan 安装 perl 模块 Net::Packet 和 Net::Pcap 但它抱怨找不到 pcap 库。所以我正在搜索 cpan 在安装模块时是否接受外部 lib/include 目录,但到目前为止还没有运气。
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。 有人知道如何解决这个问题吗?谢谢
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.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my pcap library is located at /opt/local/lib and header at /opt/local/include/pcap.
Anyone know how to solve this issue? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
README 文件。 org/perldoc?Net%3a%3aPcap" rel="nofollow">Net::Pcap 显示了如何告诉 Makefile.PL 在哪里可以找到 pcap 库:(
我已将您的路径插入到示例中。)
然而,得到 cpan shell 将这些参数传递给 Makefile.PL 相当复杂。您必须使用 Distroprefs 系统并创建一个 YAML 文件来提供论据。如果您还不熟悉 Distroprefs,那么手动安装 Net::Pcap 可能会更容易。
The README file for Net::Pcap shows how to tell Makefile.PL where to find the pcap library:
(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.
这解决了我的问题:
This fixed my issue:
在 Ubuntu 上,只需安装 libnet-pcap-perl。
On Ubuntu, just install libnet-pcap-perl.