執(zhí)行完configure后make,報(bào)錯(cuò):
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目錄下執(zhí)行l(wèi)s,發(fā)現(xiàn)是存在bio.h
執(zhí)行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"
目前就不知道怎么回事了
編譯環(huán)境是linux,各位給個(gè)提示,怎么查問題?
這是 libevent 與 openssl 版本不兼容導(dǎo)致。
一般來說,它們的版本關(guān)系是這樣的
libevent | openssl |
---|---|
2.1.x | 1.1 |
2.0.x | 1.0 |
因此你有兩個(gè)選擇
下面針對(duì)第二種選擇做詳細(xì)說明,這種方法是通用的,適用于編譯其他軟件時(shí)出現(xiàn)版本不兼容問題。
首先安裝 openssl 1.0 版本,注意需要頭文件。你可以選擇從源碼安裝,或使用操作系統(tǒng)的倉(cāng)庫(kù)下載安裝。
這類安裝包通常帶有 "*-dev" 字樣,比如 centos 發(fā)行版可能是這樣的
yum install openssl-devel-1.0xxx
openssl 安裝完成后,會(huì)有一個(gè) pkgconfig/ 目錄,實(shí)際路徑取決于你上一步的操作,一般位于 /usr/lib 或 /usr/local/lib 下。
這里我們假設(shè)是 /usr/local/lib/openssl-1.0/pkgconfig/, 你需要將它設(shè)置成 PKG_CONFIG_PATH 的環(huán)境變量值,如
export PKG_CONFIG_PATH=/usr/local/lib/openssl-1.0/pkgconfig/
切換到 libevent 源碼目錄,把 openssl 頭文件路徑,及庫(kù)文件路徑加入 configure 配置變量,如
./configure CFLAGS="$(pkg-config --cflags openssl)" LDFLAGS="$(pkg-config --libs openssl)"
清除原內(nèi)容,并重新編譯即可
make clean
make -j8
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。