GnuTLS Libnettle 3.4未找到。

10

当我尝试配置GnuTLS时,出现了Libnettle 3.4未找到的错误。我已经安装了nettle 3.4.1-1,并且库文件位于/usr/lib中。即使我直接指定环境变量NETTLE_LIBSexport NETTLE_LIBS="-L/usr/lib -R/usr/lib -lnettle"),它仍然会抛出那个错误信息。

在config.log中有以下更具体的消息:

Package dependency requirement 'nettle >= 3.4.1' could not be satisfied.
Package 'nettle' has version '3.4', required version is '>= 3.4.1'

我在这里缺少什么?


你使用的是什么架构?你是否尝试交叉编译GnuTLS? - JCMiguel
2
已经快两个月了,但我认为我通过按照源代码中的安装说明并构建nettle的新版本来解决了它(请参见:https://gitlab.com/gnutls/gnutls/blob/master/INSTALL.md#compilation)。 - DevJoe
macOS 10.14.6出现了相同的问题:找不到Libnettle 3.4.1。可以访问http://pkgconfig.freedesktop.org/releases/以获取帮助。 - Oleksii Kyslytsyn
1
在config.log中提到我们应该Package nettle was not found in the pkg-config search path. Perhaps you should add the directory containing 'nettle.pc' to the PKG_CONFIG_PATH environment variable. No package 'nettle' found。我在<libfolder>/pkgconfig/中找到了nettle.pc。 - Harish Ganesan
5个回答

7

gnutls 需要 PKG_CONFIG 包含 nettle.pchogweed.pc,但在我在 Linux Ubuntu 20.04 x64 上构建的 nettle3 中,这些文件并未复制到 /usr/lib/pkgconfig/,因此我不得不按照以下方式配置 gnutls3

PKG_CONFIG_PATH="$NETTLE3_ROOT:$PKG_CONFIG_PATH" ./configure --with-included-libtasn1 --with-included-unistring

其中NETTLE3_ROOTnettle3源代码的路径。


谢谢您提供的解决方案!这正是我一直在寻找的。 - Kris Stern
顺便提一下,为了让我的 PKG_CONFIG_PATH 起作用,我需要在我的情况下使用 "/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" - Kris Stern

2

这个包对我有用:

sudo apt-get install nettle-dev

2
当您安装 nettle 时,请尝试将安装路径指定为 /usr/,否则它将使用默认的 /usr/local/
./configure --prefix=/usr/ && make && make install
< p > < code > gnutls 将在 < code > /usr/ 中搜索依赖项。

我尝试过这个,但由于某些原因它在我的设置中没有起作用。 - Kris Stern
它对我没有起作用。 - Mojtaba Rezaeian

0

我在我的系统上需要执行以下步骤:

  • 安装缺失的 pkg-config 工具
  • 配置环境变量 PKG_CONFIG_PATH,将 pkgconfig 目录添加到 libnettle 安装前缀下
  • 使用以下配置标志来配置 libnettle 安装:./configure --disable-openssl --enable-shared --enable-mini-gmp--enable-mini-gmp 标志会导致 libhogweed 被构建)

0
对于ARM64架构:
下载nettle 3.6源代码包。
cd nettle-3.6
./configure --prefix=/usr/local/
sudo make
sudo make install
cd gnutls-3.7.9
./configure --with--included-libtasn1 --with-included-unistring -without-p11-kit
make
sudo make install

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接