使用 cygwin 在 Windows 上构建 memcached 1.4.x 错误

发布于 2024-11-26 19:47:06 字数 1415 浏览 2 评论 0原文

我正在尝试在 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'

有什么我错过的吗?

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   -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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蛮可爱 2024-12-03 19:47:06

首先,您必须配置 静态链接

export CFLAGS='-static -static-libgcc'

然后只需添加强制转换到 sanitycheck 中的 int

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

如果你想要 testapp.c 我必须将 sigaction init 更改为

struct sigaction 动作; // 这里的 init 不适用于 cygwin gcc 4.5.3
动作.sa_flags=0; 
action.sa_handler=SIG_IGN;

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;
嗼ふ静 2024-12-03 19:47:06

问题是他们用 -Werror 配置了 CFLAGS 。因此,您收到的警告停止了构建。

您可以编辑 Makefile,删除 -Werror,然后您应该能够继续构建。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文