CentOS 6 编译 libnl-3.2.25

作者: JavasBoy 分类: network 发布时间: 2015-09-07 12:19 ė12,077 views 6没有评论

一、有一个软件编译的时候提示为:“libnl3: no”,解决方法是安装 libnl。这里选择编译安装最新版 libnl-3.2.25.tar.gz,编译过程如下:

wget http://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar zxvf libnl-3.2.25.tar.gz
cd libnl-3.2.25
./configure --prefix=/usr/
make && make install

二、执行 ./configure 后有如下提示:

-------------------------------------------------------------------------------
                                  NOTE

 There have been some changes starting with 3.2 regarding where and how libnl
 is being installed on the system in order to allow multiple libnl versions
 to be installed in parallel:

    - Headers will be installed in ${prefix}/include/libnl3, therefore
      you will need to add "-I/usr/include/libnl3" to CFLAGS

    - The library basename was renamed to libnl-3, i.e. the SO names become
      libnl-3.so., libnl-route-3.so, etc.

    - libtool versioning was assumed, to ease detection of compatible library
      versions.

 If you are using pkg-config for detecting and linking against the library 
 things will continue magically as if nothing every happened. If you are 
 linking manually you need to adapt your Makefiles or switch to using 
 pkg-config files.

-------------------------------------------------------------------------------

三、再次编译那个软件的时候需要先执行如下命令,让编译能找到对应的lib

export LIBGNUTLS_LIBS="-L/usr/lib/ -lgnutls"
export LIBGNUTLS_CFLAGS="-I/usr/include/"

export LIBNL3_CFLAGS="-I/usr/include/libnl3"
export LIBNL3_LIBS="-L/usr/lib/ -lnl-3 -lnl-route-3"

四、libnl3 是什么?
核心库(core library)提供了使用 netlink 套接字进行通信的基础功能。它处理套接字的连接建立和断开、发送和接收数据、构造和解析消息、提供可配置的接收状态机。除此之外它还提供了一套抽象数据类型的框架,这套框架使得基于对象的 netlink 协议实现起来更加的简单,在这种协议中,对象可以通过基于 netlink 的协议来添加、删除、或者修改。
具体请阅读如下链接: http://blog.guorongfei.com/netlink/2015/01/20/libnl-translation-part1.html

本文出自 刘荣星的博客,转载时请注明出处及相应链接。

本文永久链接: https://www.liurongxing.com/centos-6-compile-libnl-3-2-25.html

0

发表评论

电子邮件地址不会被公开。 必填项已用*标注


*

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Ɣ回顶部