[C++-sig] Trying to install a module (Agrepy)
Reggie Smith
reg3777 at yahoo.com
Thu Oct 6 22:34:20 CEST 2005
Hello, everyone. I am trying to install a python
module called agrepy which is a fuzzy string search
tool. However, when the makefile runs I get many
errors like this:
"undefined reference to '_Pystring....
referencing one of the C files that the makefile uses.
I am using GCC 3.4.4 and Cygwin 1.5.18 on Win XP SP2.
>From scanning previous threads I feel very sure this
is a Cygwin specific problem. Am I having it point to
the wrong library or something? The makefile is below:
VERSION=1.2
# Edit this to point to the directory tree in which
Python is found
#PYTHONROOT=/sw
PYTHONROOT=/usr/local
# Linux
CC = gcc
# When testing
# Uncomment one of these when creating C only version
for testing (see also output below)
# CFLAGS = -g -Wall -Wshaddow -DDEBUG -DDEBUGDEBUG
# for agrepy_test
# CFLAGS = -g # for agrepy_test (free standing C
application)
OPTFLAGS = -O3
# The following flag is relevant to Linux but is not
not recognized
# by MacOS X posix compiler so comment it out
LDFLAGS = -shared
# Some compilers (not Mac) insist you add -fpic when
compiling to get .so
LDFLAGS = -shared #-fPIC
# For Mac OSX
# You will need to make the final argument refer to
where the binary lives
LDFLAGS = $(PYTHONROOT)/bin/python2.3
CFLAGS= -DPYTHON $(FPIC) $(OPTFLAGS)
INCLUDES = -I$(PYTHONROOT)/include/python2.3
ALLOBJS = sagrepy.o lagrepy.o agrepy.o agrepy_wrap.o
TESTOBJS = sagrepy.o lagrepy.o agrepy.o
# Uncomment output : agrepy_test when building C only
version for testing
output : _agrepy.pyd
# output : agrepy_test
# This is a C-only implementation for testing purposes
agrepy_test: $(TESTOBJS)
$(CC) $(CFLAGS) -o agrepy_test $(TESTOBJS)
\usr\local\lib\python2.3 libpython2.3.dll.a
_agrepy.pyd : $(ALLOBJS)
$(CC) $(LDFLAGS) $(INCLUDES) $(ALLOBJS) -o $@
agrepy_wrap.o : agrepy_wrap.c
$(CC) $(CFLAGS) -c agrepy_wrap.c $(INCLUDES)
agrepy_wrap.c : agrepy.i
swig -python agrepy.i
$(ALLOBJS): agrepy.h
clean:
rm -f $(ALLOBJS) agrepy_wrap.doc
new:
rm -f $(ALLOBJS)
make
tarfile:
mkdir agrepy_${VERSION}
cp `cat FILES` agrepy_${VERSION}
cp FILES agrepy_${VERSION}
tar cvf agrepy_${VERSION}.tar agrepy_${VERSION}
gzip agrepy_${VERSION}.tar
/bin/rm -r agrepy_${VERSION}
Thanks for any help.
Reggie
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
More information about the Cplusplus-sig
mailing list