error: field 'ctx' has incomplete type EVP_CIPHER_CTX

error: field 'ctx' has incomplete type EVP_CIPHER_CTX

问题:我需要将 Cepstral(tts 引擎)安装到 Freeswitch 运行ning Debian 8 中。Freeswitch 已经启动并且 运行ning,但我需要从源代码构建它以便它创建 mod_cepstral 模块。

当我 运行 make 这是我得到的错误:

In file included from ./crypto/include/prng.h:17:0,
                 from ./crypto/include/crypto_kernel.h:50,
                 from ./include/srtp.h:53,
                 from srtp/srtp.c:46:
./crypto/include/aes_icm_ossl.h:66:20: error: field ‘ctx’ has incomplete type
     EVP_CIPHER_CTX ctx;
                    ^~~
In file included from srtp/srtp.c:50:0:
./crypto/include/aes_gcm_ossl.h:58:18: error: field ‘ctx’ has incomplete type
   EVP_CIPHER_CTX ctx;
                  ^~~
Makefile:646: recipe for target 'srtp.lo' failed
make[1]: *** [srtp.lo] Error 1
make[1]: Leaving directory '/usr/src/freeswitch/libs/srtp'
Makefile:3931: recipe for target 'libs/srtp/libsrtp.la' failed
make: *** [libs/srtp/libsrtp.la] Error 2

我一直在互联网上搜索解决方案,但我不是开发人员,这让我难以理解。任何帮助,将不胜感激。

似乎对 OpenSSL 存在依赖性,但您使用的 OpenSSL 版本不兼容。您正在使用 OpenSSL 1.1.0 但您需要使用 OpenSSL 1.0.2

wget https://github.com/cisco/libsrtp/archive/v2.1.0.tar.gz
tar xfv v2.1.0.tar.gz
cd libsrtp-2.1.0
./configure --prefix=/usr --enable-openssl
make shared_library && sudo make install

获取最新版本libsrtp

在与 Cepstral 的支持人员交谈后,我们确定 Jessie (Debian 8) 尚未完全兼容。我用 Debian 7 重建了服务器,现在运行良好。

因为较新的 OpenSSL 不公开 strcut EVP_CIPHER_CTX ,

试试这个

EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
//do sth here
//...
EVP_CIPHER_CTX_free(ctx);