首页 > 解决方案 > 如何修复星号 1.8.18+ 编译错误?

问题描述

我正在编译 Asterisk 1.8.32.3(错误从 1.8.18 持续存在),最后我得到了这个错误:

root@ubuntu:/usr/src/asterisk-1.8.32.3# make
CC="cc" CXX="" LD="" AR="" RANLIB="" CFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts
make[1]: Entering directory '/usr/src/asterisk-1.8.32.3/menuselect'
make[1]: 'makeopts' is up to date.
make[1]: Leaving directory '/usr/src/asterisk-1.8.32.3/menuselect'
   [CC] tcptls.c -> tcptls.o
*tcptls.c: In function ‘tcptls_stream_close’:
tcptls.c:401:20: error: dereferencing pointer to incomplete type
    if (!stream->ssl->server) {*
                    ^
tcptls.c:403:5: warning: ‘ERR_remove_state’ is deprecated (declared at /usr/include/openssl/err.h:261) [-Wdeprecated-declarations]
     ERR_remove_state(0);
     ^
tcptls.c: In function ‘__ssl_setup’:
tcptls.c:768:4: warning: implicit declaration of function ‘SSLv2_client_method’ [-Wimplicit-function-declaration]
    cfg->ssl_ctx = SSL_CTX_new(SSLv2_client_method());
    ^
tcptls.c:768:4: warning: passing argument 1 of ‘SSL_CTX_new’ makes pointer from integer without a cast [enabled by default]
In file included from /usr/src/asterisk-1.8.32.3/include/asterisk/tcptls.h:59:0,
                 from tcptls.c:44:
/usr/include/openssl/ssl.h:1503:17: note: expected ‘const struct SSL_METHOD *’ but argument is of type ‘int’
 __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
                 ^
tcptls.c:773:4: warning: implicit declaration of function ‘SSLv3_client_method’ [-Wimplicit-function-declaration]
    cfg->ssl_ctx = SSL_CTX_new(SSLv3_client_method());
    ^
tcptls.c:773:4: warning: passing argument 1 of ‘SSL_CTX_new’ makes pointer from integer without a cast [enabled by default]
In file included from /usr/src/asterisk-1.8.32.3/include/asterisk/tcptls.h:59:0,
                 from tcptls.c:44:
/usr/include/openssl/ssl.h:1503:17: note: expected ‘const struct SSL_METHOD *’ but argument is of type ‘int’
 __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
                 ^
tcptls.c:775:4: warning: ‘TLSv1_client_method’ is deprecated (declared at /usr/include/openssl/ssl.h:1879) [-Wdeprecated-declarations]
    cfg->ssl_ctx = SSL_CTX_new(TLSv1_client_method());
    ^
/usr/src/asterisk-1.8.32.3/Makefile.rules:109: recipe for target 'tcptls.o' failed
make[1]: *** [tcptls.o] Error 1
Makefile:351: recipe for target 'main' failed
make: *** [main] Error 2

最重要的是行:

tcptls.c: In function ‘tcptls_stream_close’:
tcptls.c:401:20: error: dereferencing pointer to incomplete type
    if (!stream->ssl->server) {
                    ^

我正在使用 dahdi 2.11.2 和 g++/gcc 4.8;在 Ubuntu 16.04 上编译

有人知道如何解决这个问题吗?

PS 我只需要在 Ubuntu 16.04 上编译星号 1.8.18+。

标签: asterisk

解决方案


您应该使用较旧的 SSL 版本(通常也意味着其他操作系统)或较新的星号版本。

不再支持 1.8.x。


推荐阅读