简体   繁体   English

在Centos 7上的libgcrypt中找不到宏

[英]Macro not found in libgcrypt on Centos 7

I have a C program that uses libgcrypt . 我有一个使用libgcrypt的C程序。 I put this string in the builder to install the libraries for Centos 7: 我将此字符串放在构建器中以安装Centos 7的库:

yum -y install json-c-devel expat-devel libpcap-devel flex-devel automake libtool bison libuv-devel openssl-devel libgcrypt-devel

and no problem come out. 并没有问题出来。

Unfortunately, the compilation of the code terminate with an error caused by a macro cannot be found: 不幸的是,无法找到代码的编译以宏引起的错误终止:

error: 'GCRY_CIPHER_MODE_GCM' undeclared (first use in this function) 错误:'GCRY_CIPHER_MODE_GCM'未声明(首次使用此功能)

The macro is inside the libgcrypt for sure, so I really don't understand how cannot be found at all. 这个宏肯定在libgcrypt里面,所以我真的不明白怎么也找不到。

If I compile the same code in Debian, it works well and the macro is resolved properly. 如果我在Debian中编译相同的代码,它运行良好,并正确解析宏。

PS My system is Debian 8 and I use docker for Centos 7 PS我的系统是Debian 8,我使用docker for Centos 7

CentOS-7 uses libgcrypt and libgcrypt-devel version 1.5 (patched), which seems to not include GCRY_CIPHER_MODE_GCM declaration. CentOS-7使用libgcryptlibgcrypt-devel版本1.5(修补),似乎不包括GCRY_CIPHER_MODE_GCM声明。

Looking at the git commits, it seems to have been available in 1.6+. 看看git提交,它似乎已经在1.6+中提供。

https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=90cce18b9eced4f412ceeec5bcae18c4493322df https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=90cce18b9eced4f412ceeec5bcae18c4493322df

On a newer version, you would see a line in /usr/include/gcrypt.h , like the following: 在较新的版本中,您会在/usr/include/gcrypt.h看到一行,如下所示:

GCRY_CIPHER_MODE_GCM      = 9,   /* Galois Counter Mode. */

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM