libevent学習ノート(一)————初探libevent

2024 ワード

環境:
Ubuntu 12.04
unameプロパティ:
Linux ubuntu 3.5.0-28-generic#47~precise1-Ubuntu SMP Wed Apr 10 15:10:23 UTC 2013 i686 athlon i386 GNU/Linux
libeventのコンパイルの紹介:
コンパイル方法:
#!/bin/bash

###############################################
#Robin
###############################################

CUR_DIR=$(readlink -f `pwd`)
SOURCE_DIR=$(readlink -f `pwd`)


rm $SOURCE_DIR/log
./configure --prefix=$SOURCE_DIR/_install >> log  2>&1

make >> log 2>&1 && make install >> log 2>&1

Q1:
ipv6-internal.h:53:8: error: redefinition of 'struct in6_addr'
/usr/include/netinet/in.h:198:8: note: originally defined here
ipv6-internal.h:54:13: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
ipv6-internal.h:59:13: error: conflicting types for 'sa_family_t'
/usr/include/i386-linux-gnu/bits/sockaddr.h:29:28: note: previous declaration of 'sa_family_t' was here
ipv6-internal.h:63:8: error: redefinition of 'struct sockaddr_in6'
/usr/include/i386-linux-gnu/sys/socket.h:92:17: note: originally defined here
In file included from buffer.c:94:0:
util-internal.h:337:8: error: redefinition of 'struct sockaddr_storage'
/usr/include/i386-linux-gnu/bits/socket.h:193:8: note: originally defined here
make[1]: *** [buffer.lo] Error 1


A1:
#!/bin/bash

###############################################
#Robin
###############################################

CUR_DIR=$(readlink -f `pwd`)
SOURCE_DIR=$(readlink -f `pwd`)

export CFLAGS=" -DEVENT__HAVE_STRUCT_IN6_ADDR -DEVENT__HAVE_SA_FAMILY_T -DEVENT__HAVE_STRUCT_SOCKADDR_IN6 -DEVENT__HAVE_STRUCT_SOCKADDR_STORAGE "

rm $SOURCE_DIR/log
./configure --prefix=$SOURCE_DIR/_install >> log  2>&1

make >> log 2>&1 && make install >> log 2>&1
unset CFLAGS