如何在Ubuntu 12.04上安装libcap?

时间:2014-05-22 11:24:03

标签: c linux networking ubuntu-12.04

我试图让libcap在我的机器上运行(运行Ubuntu 12.04),但我目前无法完成这项工作:

以下是这一切的开始:

  1. 在Eclipse中,我收到警告说它无法解析pcap.h。 它说Unresolved inclusion <pcap.h>
  2. 我安装了这样的libcap:sudo apt-get install libcap-dev
  3. 我重新启动了我的机器。
  4. 现在我仍然收到警告,说它无法解决pcap.h

    我做错了什么?有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试安装linux-headers,但您需要了解内核版本:

例:

tiago@dell:~$ sudo uname -a
Linux dell 3.11.0-20-generic #35~precise1-Ubuntu SMP Fri May 2 21:32:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

tiago@dell:~$ sudo apt-get install linux-headers-3.11.0-20
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-3.11.0-20 is already the newest version.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.