我正在尝试在Windows上构建memcached
。这是我得到的:
$ make
make all-recursive
make[1]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
Making all in doc
make[2]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make all-am
make[3]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make[2]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make[2]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -DNDEBUG -I/usr/local/include -g -O2 -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declaration
s -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
gcc: unrecognized option '-pthread'
cc1: warnings being treated as errors
memcached.c: In function `sanitycheck':
memcached.c:4361: error: array subscript has type `char'
make[2]: *** [memcached-memcached.o] Error 1
make[2]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
有没有我错过的东西?
答案 0 :(得分:1)
首先,您必须使用static linkage
进行配置export CFLAGS='-static -static-libgcc'
然后在sanitycheck
中添加一个强制转换为int!isdigit((int)ever[3]))
如果您喜欢testapp.c,我必须将sigaction init更改为
struct sigaction action; // The init here did not work with cygwin gcc 4.5.3 action.sa_flags=0; action.sa_handler=SIG_IGN;
答案 1 :(得分:0)
问题是他们已经使用 -Werror 配置了CFLAGS。因此,警告你停止了构建。
您可以编辑Makefile,删除 -Werror ,您应该可以继续构建。