libnl-3包括坏了吗? [英] libnl-3 includes broken?

查看:452
本文介绍了libnl-3包括坏了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用libnl 3( http://www.infradead.org/~tgr/libnl/)在Ubuntu下使用netlink以便从IPv6邻居缓存中获取一些信息.

I am trying to use libnl 3 (http://www.infradead.org/~tgr/libnl/) under Ubuntu to use netlink in order to get some information from the IPv6 Neighbour Cache.

我为此库包含了一堆头文件,但是gcc对于第一个头文件已经失败了:

I am including a bunch of headers for this lib, but gcc already fails for the first one:

#include <libnl3/netlink/netlink.h>

没有libnl.h之类的主标头".

There is no "main header", like libnl.h.

>$ gcc netlink_test.c 
In file included from netlink_test.c:11:0:
/usr/include/libnl3/netlink/netlink.h:24:36: fatal error: netlink/netlink-compat.h: No such file or directory
compilation terminated.

文件netlink.h包含"netlink/netlink-compat.h".不幸的是,没有"/usr/include/netlink/"文件夹.只有"/usr/include/libnl3/netlink/"

The file netlink.h includes "netlink/netlink-compat.h". Unfortunately, there is no "/usr/include/netlink/" folder. There is only "/usr/include/libnl3/netlink/"

因此包含"netlink/netlink.h"可以给我:

Including "netlink/netlink.h" thus gives me:

netlink_test.c:10:29: fatal error: netlink/netlink.h: No such file or directory
compilation terminated.

我已经在Ubuntu 12.04下安装了以下软件包:

I have installed the following packages under Ubuntu 12.04:

libnl-3-200
libnl-3-200-dbg
libnl-3-dev
libnl-3-doc
libnl-genl-3-200
libnl-genl-3-200-dev
libnl-route-3-200
libnl-route-3-200-dev

我在这里错过了什么吗?或者这真的被打破了吗?

Am I missing here something or is this genuinely broken?

推荐答案

好的,所以包装没有坏,我是;)

OK, so the package is not broken, I am ;)

不久前,他们引入了一种机制,使用户可以安装该库的不同版本. 现在,您可以使用"pkg-config"对其进行配置,或者仅使用"-I/usr/include/libnl3/"将精确目录传递给编译器. 而且有效.

A short while ago, they introduced a mechanism to enable users to install different versions of this library. Now you can configure it using "pkg-config" or just pass the precise directory to the compiler with "-I /usr/include/libnl3/". And it works.

这篇关于libnl-3包括坏了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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