首页 > 解决方案 > ubuntu 中的编译故障错误“SSL_CTX_ctrl”从指针目标类型中丢弃“const”限定符 [-Werror=discarded-qualifiers]

问题描述

我已经下载了hitch 1.4.8,我已经安装了以下软件包,libev-dev libssl-dev automake python-docutils flex bison pkg-config,./configure 输出没有错误,但是当我使用时继续下一步并执行“make”,它给出了这个错误:

make  all-recursive
make[1]: Entering directory '/root/hitch-1.4.8'
Making all in src/util
make[2]: Entering directory '/root/hitch-1.4.8/src/util'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/hitch-1.4.8/src/util'
Making all in src
make[2]: Entering directory '/root/hitch-1.4.8/src'
make  all-am
make[3]: Entering directory '/root/hitch-1.4.8/src'
  CC       hitch-hitch.o
In file included from /usr/include/openssl/ssl.h:933:0,
                 from configuration.h:12,
                 from hitch.c:74:
hitch.c: In function ‘make_ctx_fr’:
hitch.c:995:46: error: passing argument 4 of ‘SSL_CTX_ctrl’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  if (!SSL_CTX_set_tlsext_servername_arg(ctx, fr)) {
                                              ^
In file included from configuration.h:12:0,
                 from hitch.c:74:
/usr/include/openssl/ssl.h:1821:6: note: expected ‘void *’ but argument is of type ‘const struct frontend *’
 long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg);
      ^
cc1: all warnings being treated as errors
Makefile:808: recipe for target 'hitch-hitch.o' failed
make[3]: *** [hitch-hitch.o] Error 1
make[3]: Leaving directory '/root/hitch-1.4.8/src'
Makefile:600: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/hitch-1.4.8/src'
Makefile:527: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/hitch-1.4.8'
Makefile:361: recipe for target 'all' failed
make: *** [all] Error 2

我以前在 ubuntu 16.04 上做过这个,但我不确定发生了什么。我在使用 aws 服务器的 linuxacademy 上执行此操作。有什么想法吗?

标签: ubuntu-16.04

解决方案


推荐阅读