使用 pf_ring 链接到 pcap
我正在尝试使用用 pf_ring 编译的 libpcap。 我从 ntop 获取了源代码,并编译了它。
但是,有一些我不明白的地方(抱歉新手链接问题): 我想知道我的应用程序是否使用了正确的 pcap 版本(带有 pfring 的版本), 所以我输入了ldd,但根本没有看到pcap,只有pfring。
我查看了输出,只看到了 pfring.so 而不是 pcap,尽管我动态链接到了这两个库。
我查看了 libpcap 的 Makefile,发现它与 pfring.a 静态链接。 我认为我根本不必与 pfring 链接,因为它是 pcap 的一部分,但得到了未定义的引用。
有谁知道为什么我收到未定义的引用错误以及为什么当我动态链接到它时在 ldd 输出中看不到 libpcap ?
谢谢, 罗恩
I'm trying to use libpcap that was compiled with pf_ring.
I got the sources from ntop, and compiled it.
However, there's something I don't understand (sorry for the newbie linking question):
I wanted to know if my application used the correct pcap version (the one with pfring),
so I typed ldd and didn't see pcap at all, only pfring.
I looked at the output and saw only pfring.so and not pcap, although I dynamically linked to both libs.
I looked at the Makefile of libpcap and saw it linked statically with pfring.a.
I thought I don't have to link with pfring at all, because it's a part of pcap, but got undefined reference.
Does anyone know why I get the undefined reference error and why don't I see libpcap in the ldd output when I link to it dynamically?
Thanks,
Ron
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,确保您执行了以下所有步骤:
然后从系统中删除当前的 libpcap 及其所有依赖项。
如您所知,启用 pfring 的 libpcap 位于 /userland/libpcapx 下。
如果您在应用程序中使用启用了 pf_ring 的 libpcap,只需将 libpcap.a 链接到您的程序即可。
First of all make sure you did all of the following steps:
then remove the current libpcap and all of its dependencies from your system.
the pfring enabled libpcap is under /userland/libpcapx as you know.
if you are using pf_ring enabled libpcap in your application simply link libpcap.a to your program.