安装环境
HP-UX 125RITEC B.11.31 U ia64 0942432495
gcc (GCC) 4.3.1
libevent-1.4.14b-stable.tar.gz
memcached-1.4.13.tar.gz(安装失败)
memcached-1.4.5-LINUX.tar.gz(安装成功)
1,./configure 提示错误 make失败
解决:更换安装版本为memcached-1.4.5-LINUX.tar.gz,原版本memcached-1.4.13.tar.gz
checking for endianness... little
checking for htonll... no
checking for library containing pthread_create... no
configure: error: Can‘t enable threads without the POSIX thread library.
wapapp:/wapapp/keld/tools/memcache/memcached-1.4.13>make
Make: No arguments or description file. Stop.
wapapp:/wapapp/keld/tools/memcache/memcached-1.4.13>make
Make: No arguments or description file. Stop.
2,make时报错
解决:执行configure 前增加环境变量设置:env CFLAGS=-D_XOPEN_SOURCE_EXTENDED
Shell代码
- env CFLAGS=-D_XOPEN_SOURCE_EXTENDED ./configure --with-libevent=/wapapp/tools/installed/libevent --prefix=/wapapp/tools/installed/memcache
wapapp:/wapapp/keld/tools/memcache/memcached-1.4.5>make
make all-recursive
Making all in doc
No suffix list.
make all-am
No suffix list.
/bin/sh ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -DNDEBUG -I/wapapp/tools/installed/libevent/include -g -O2 -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f ‘memcached.c‘ || echo ‘./‘`memcached.c
cc1: warnings being treated as errors
memcached.c: In function ‘add_msghdr‘:
memcached.c:228: error: assignment from incompatible pointer type
memcached.c: In function ‘try_read_udp‘:
memcached.c:3206: error: passing argument 6 of ‘recvfrom‘ from incompatible pointer type
memcached.c: In function ‘drive_machine‘:
memcached.c:3432: error: passing argument 3 of ‘accept‘ from incompatible pointer type
memcached.c: In function ‘maximize_sndbuf‘:
memcached.c:3766: error: passing argument 5 of ‘getsockopt‘ from incompatible pointer type
memcached.c: In function ‘server_socket‘:
memcached.c:3888: error: passing argument 3 of ‘getsockname‘ from incompatible pointer type
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
3,make时报错
解决:在util.c中增加如下函数(isspace_t),将util.c中所有的isspace换为isspace_t
C代码
- extern int isspace_t __((int));
- int isspace_t(int ch){
- return (unsigned int)(ch - 9) < 5u || ch == ‘ ‘;
- }
Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-util.o -MD -MP -MF .deps/memcached-util.Tpo -c -o memcached-util.o `test -f ‘util.c‘ || echo ‘./‘`util.c
cc1: warnings being treated as errors
util.c: In function ‘safe_strtoull‘:
util.c:19: error: array subscript has type ‘char‘
util.c: In function ‘safe_strtoll‘:
util.c:42: error: array subscript has type ‘char‘
util.c: In function ‘safe_strtoul‘:
util.c:62: error: array subscript has type ‘char‘
util.c: In function ‘safe_strtol‘:
util.c:86: error: array subscript has type ‘char‘
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.