开发者

Building memcached 1.4.x on windows error with cygwin

I'm trying to build memcached on Windows. Here's what I get:

$ 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   开发者_Python百科-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'

Is there something that I've missed?


First, you must configure with static linkage

export CFLAGS='-static -static-libgcc'

Then just add a cast to int in sanitycheck

!isdigit((int)ever[3]))

If you'd like the testapp.c I had to change the sigaction init to

struct sigaction action; // The init here did not work with cygwin gcc 4.5.3
action.sa_flags=0; 
action.sa_handler=SIG_IGN;


The problem is that they've configured CFLAGS with -Werror . Hence the warning you got stopped the build.

You can edit the Makefile, remove -Werror and you should be able to continue with the build.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜