centos 编译libevent_linux无法编译libevent,一直报错,但是我有装openssl

在CentOS上编译libevent时遇到错误,提示指向incomplete type,尽管已安装openssl。编译过程中报错涉及bufferevent_openssl.c文件中的多个函数。查看/usr/include/openssl目录确认bio.h存在,且openssl版本为1.1.0g。问题可能与编译选项或库链接有关,寻求解决方案。
摘要由CSDN通过智能技术生成

执行完configure后make,报错:

make

make all-recursive

make[1]: Entering directory `/libevent-2.0.21-stable'

Making all in .

make[2]: Entering directory `/libevent-2.0.21-stable'

/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -g -O2 -Wall -fno-strict-aliasing -pthread -MT bufferevent_openssl.lo -MD -MP -MF .deps/bufferevent_openssl.Tpo -c -o bufferevent_openssl.lo bufferevent_openssl.c

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -g -O2 -Wall -fno-strict-aliasing -pthread -MT bufferevent_openssl.lo -MD -MP -MF .deps/bufferevent_openssl.Tpo -c bufferevent_openssl.c -fPIC -DPIC -o .libs/bufferevent_openssl.o

bufferevent_openssl.c: In function 'bio_bufferevent_new':

bufferevent_openssl.c:106:3: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:107:3: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:108:3: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:109:3: error: dereferencing pointer to incomplete type

bufferevent_openssl.c: In function 'bio_bufferevent_free':

bufferevent_openssl.c:119:7: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:120:8: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:120:19: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:121:22: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:122:4: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:123:4: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:124:4: error: dereferencing pointer to incomplete type

bufferevent_openssl.c: In function 'bio_bufferevent_read':

bufferevent_openssl.c:140:8: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:143:33: error: dereferencing pointer to incomplete type

bufferevent_openssl.c: In function 'bio_bufferevent_write':

bufferevent_openssl.c:159:31: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:165:8: error: dereferencing pointer to incomplete type

bufferevent_openssl.c: In function 'bio_bufferevent_ctrl':

bufferevent_openssl.c:191:31: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:196:10: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:199:4: error: dereferencing pointer to incomplete type

bufferevent_openssl.c: At top level:

bufferevent_openssl.c:228:1: error: variable 'methods_bufferevent' has initializer but incomplete type

bufferevent_openssl.c:229:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:229:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:229:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:229:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:230:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:230:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:231:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:231:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:232:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:232:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:233:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:233:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:234:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:234:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:235:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:235:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:236:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:236:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c:237:2: warning: excess elements in struct initializer [enabled by default]

bufferevent_openssl.c:237:2: warning: (near initialization for 'methods_bufferevent') [enabled by default]

bufferevent_openssl.c: In function 'BIO_new_bufferevent':

bufferevent_openssl.c:257:8: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:258:8: error: dereferencing pointer to incomplete type

bufferevent_openssl.c:259:8: error: dereferencing pointer to incomplete type

查看106行文件,是BIO *h

static int

bio_bufferevent_new(BIO *b)

{

b->init = 0;

b->num = -1;

b->ptr = NULL; /* We'll be putting the bufferevent in this field.*/

b->flags = 0;

return 1;

}

但是我的/usr/include/openssl目录下执行ls,发现是存在bio.h

执行openssl version -a:

OpenSSL 1.1.0g 2 Nov 2017

built on: reproducible build, date unspecified

platform: dist

compiler: cc -DNDEBUG -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\""

OPENSSLDIR: "/usr/local/ssl"

ENGINESDIR: "/usr/local/lib/engines-1.1"

目前就不知道怎么回事了

编译环境是linux,各位给个提示,怎么查问题?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值