东京内阁不在cygwin上编译

时间:2011-01-29 09:36:13

标签: cygwin tokyo-cabinet

我完全是cygwin的新手,我正在尝试编译东京内阁 我得到以下错误,无法弄清楚为什么我有这个冲突 有人可以帮助我吗?

由于

$ make
gcc -c -I. -I/usr/local/include -I/home/Larry/include -I/usr/local/include -DND
EBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__ -D_TC_PREFIX="\"/usr/local\""
 -D_TC_INCLUDEDIR="\"/usr/local/include\"" -D_TC_LIBDIR="\"/usr/local/lib\"" -D_
TC_BINDIR="\"/usr/local/bin\"" -D_TC_LIBEXECDIR="\"/usr/local/libexec\"" -D_TC_A
PPINC="\"-I/usr/local/include\"" -D_TC_APPLIBS="\"-L/usr/local/lib -ltokyocabine
t -lbz2 -lz -lrt -lpthread -lm -lc \"" -g -O2 -std=c99 -Wall -fPIC -fsigned-char
 -O2 tcutest.c
tcutest.c:1: warning: -fPIC ignored for target (all code is position independent
)
tcutest.c:31: error: conflicting types for 'iprintf'
/usr/include/stdio.h:259: error: previous declaration of 'iprintf' was here
make: *** [tcutest.o] Error 1

1 个答案:

答案 0 :(得分:3)

有点烦人。全局将iprintf重命名为my_iprintf或类似名称。我没有cygwin,但只是在Linux上试过,这很有效:

$ sed -i.bak 's/iprintf/my_iprintf/g' *.c *.h bros/*.c
$ ./configure
... blah blah configuring blah blah ...
#================================================================
# Ready to make.
#================================================================
$ make
... blah blah building blah blah ...
#================================================================
# Ready to install.
#================================================================
$ ./tctmgr --version
Tokyo Cabinet version 1.4.46 (909:1.0) for Linux
Copyright (C) 2006-2010 FAL Labs

IIRC cygwin有GNU coreutils,其中包括sed,但是自从我使用它以来已经有一段时间了。提示:保留tarball,以便在出错时重新解压缩,但sed命令也会保留备份。