我曾多次尝试在CentOS6.2上编译GnuTLS库,但都没有成功。以下是步骤:
我下载了Nettle 2.4
[root@localhost opt]# wget http://www.lysator.liu.se/~nisse/archive/nettle-2.4.tar.gz
[root@localhost nettle-2.4]# tar zxvf nettle-2.4.tar.gz
[root@localhost nettle-2.4]# cd nettle-2.4
[root@localhost nettle-2.4]# ./configure --enable-shared --prefix=/usr
Version: nettle 2.4
Host type: x86_64-unknown-linux-gnu
ABI: 64
Assembly files: x86_64
Install prefix: /usr
Library directory: ${exec_prefix}/lib64
Compiler: gcc
Shared libraries: yes
Public key crypto: no我运行命令make和make install
我下载了最新的GnuTLS
./configure --with-libnettle-prefix=/usr
hecking for shared library run path origin... done
checking whether to use nettle... yes
checking for libnettle... no
configure: error:
***
*** Libnettle 2.4 was not found.我遗漏了什么?
谨致问候
发布于 2012-03-01 16:59:08
configure:8798: checking for libnettle
configure:8820: gcc -std=gnu99 -o conftest -g -O2 conftest.c /usr/lib/libnettle.so /usr/lib/libhogweed.so -lgmp >&5
/usr/bin/ld: cannot find -lgmp
collect2: ld returned 1 exit status
configure:8820: $? = 1
configure: failed program was:
configure:8830: result: no
configure:8856: error:
***
*** Libnettle 2.4 was not found.我安装了gmp-devel。问题已解决。
发布于 2013-09-28 00:13:15
问题是,除非如您所观察到的那样,存在libgmp的开发头文件,否则nettle不会构建libhogweed。不幸的是,文档和.configure --help以及configure的输出并没有说明这一点。
同时,gnuTLS文档也没有解释这一点(正如您注意到的,这里的配置输出没有多大帮助)。尽管libgmp被列为pre-req,但出于某种原因,libhogweed不是(可能是因为它被假定为nettle的一部分)。配置错误“无法找到-lgmp”的原因是libgmp不存在,但libgmp也不会出现,因为它是libhogweed.so的隐藏可选部分。如果您随后安装了libgmp-dev并只为gnutls运行configure,您将得到相同的"checking for libnettle... no“。这应该是“检查libhogweed……不”,但负责conf脚本的人太懒了,不会破坏这一点(我想可以提交一个补丁)。
换句话说,在构建gnutls之前,您需要安装libgmp-dev,然后重新构建nettle。
发布于 2017-03-22 02:15:36
我安装了nettle-dev & nettle-bin,它可以正常工作:)
https://stackoverflow.com/questions/9508851
复制相似问题