pcap.h头文件问题
任何人都知道如何解决 ubuntu 10.10 中有关头文件的问题。 我正在执行一个使用此头文件的嗅探程序。我的系统显示 libcap 软件包已安装。尽管如此,在编译代码时,出现了一个错误,内容如下:
fatal error: pcap.h: No such file or directory 编译终止。
请帮帮我。
谢谢大家:)
anyone know how to fix the problem regarding header file in ubuntu 10.10.
I am executing a sniffing program which makes use of this header file. My system shows libcap package is installed. Still, on compiling the code, an error is coming which reads:
fatal error: pcap.h: No such file or directory
compilation terminated.
Please help me out.
Thanks all:)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
系统不会让我纠正 Eric Fossum 的评论,因为我缺乏声誉。有一个拼写错误(“libcap”与“libpcap”),他建议的命令应如下所示:
The system won't let me correct Eric Fossum's comment, because I lack reputation. There is a typo ("libcap" vs. "libpcap") and his suggested command should read the following:
如果您使用 yum,那么
If you are using yum, then
您的包含路径中没有 pcap.h 文件。编译时需要将pcap.h的位置添加到包含路径中:
-I/path/to/pcap.h
You don't have the pcap.h file in your include path. You need to add the location of pcap.h to your include path when compiling:
-I/path/to/pcap.h
如果您使用的是 linuxbrew,则只需
brew install libpcap
即可。就我而言,我尝试安装 nethogs,但由于此错误而失败。If you're using linuxbrew, you can just
brew install libpcap
. In my case I was trying to installnethogs
and it failed with this error.首先安装 libpcap:
然后创建其头文件的快捷方式文件:
First install libpcap:
then create its shortcut for header file: