libevent 编译出错记

centos,系统运维 2017-11-06

libevent-2.0.12-stable 编译出错:

i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -g -Wall -I../include -I../include
-DVERSION=1.05 -g -L.  -o btlist btlist.c -lbt -lresolv -luuid -lssl -lcurl 
`curl-config --libs` -lm
In file included from btlist.c:16:
/usr/include/openssl/sha.h:109: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:111: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:116: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:118: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:138: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:140: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:142: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:144: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:185: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:187: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:189: error: expected declaration specifiers or '...'
before 'size_t'
/usr/include/openssl/sha.h:191: error: expected declaration specifiers or '...'
before 'size_t'

几经周折终于找到了答案:
在config.h 文件中添加一行 头文件的引用中:
#include <sys/types.h>
然后make clean之后再重新

./configure 和 make 就搞定了


本文由 伯仁 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

5 条评论

  1. levitra dosage

    levitra 5mg dosage location - ed side effects - levitra 5mg cost return to board index

  2. female viagra

    viagra tadalafil cheapest online purybbs.cgi - viagra vipps - viagra 5mg bangkok mail-order

  3. viagra for sale

    viagra 5mg bangkok mail-order - vendita on line viagra generico - viagra 20mg pills search

  4. cialis generic release date

    cialis 10mg how long does it last yahoo messenger - canadian pharmacy cialis 20mg jump to - cia[...]

  5. viagra substitute

    viagra and alcohol use - free viagra offer - non prescription generic viagra

添加新评论