0

我是 cygwin 的新手,我正在尝试编译 tokyo cabinet 我收到以下错误,无法弄清楚为什么我有这个冲突有人可以帮我吗?

谢谢

$ 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
4

1 回答 1

3

Kind of annoying. Globally rename iprintf to my_iprintf or something similar. I don't have cygwin, but just tried on Linux, and this worked well:

$ 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 has the GNU coreutils, which include sed, but it's been a while since I've used it. Hint: Keep the tarball around so you can re-untar it if you make a mistake, but the sed command also keeps backups.

于 2011-01-29T10:02:59.773 回答