Re: Can somebody help met to get pygres working on Debian 2.0?
On Wed, Aug 26, 1998 at 01:41:42AM +0200, Martin Schulze wrote:
> It would be a good idea if you would describe your problem so others are
> able to help.
Thanks for your reply. The background and present state of the
problem is this:
I have recompiled pygres 2.1 to use with postgresql 6.3.2-8. Trying
to use it results in:
---------------------------------
from pg import *
ImportError: /usr/lib/python1.5/lib-dynload/pgmodule.so: undefined
symbol: lo_creat
------------------------------------
I have the standard Debian 2.0 installation of postgresql and python
1.5.1. Previously I did not use debian packages on these programs
because the debian packages were not up to date on my 1.3.1 CD's.
All the libpq libraries are in the right places. I have used the following makefile to compile pygres:
---------------------
#!/bin/make
CC=gcc
blddir=/usr/lib/python1.5/config# This dir includes the config.h file for
# the Debianized Python distribution.
srcdir=/usr/include/python1.5/ # Here is the Python include directory.
OPT= -O # This is the standard optimization flag.
INCLUDES= -I$(blddir) -I$(srcdir) -I/usr/include/postgresql \
-L/usr/lib # This line includes
# the specific pgsql
# directories which are
# needed.
DEFINES= -DHAVE_CONFIG_H # Tell the compiler that a config.h file exists.
CFLAGS= $(OPT) $(DEFINES) $(INCLUDES)
all: pgmodule.so
pgmodule.o: pgmodule.c
$(CC) $(CFLAGS) -c pgmodule.c
pgmodule.so: pgmodule.o
ld -G pgmodule.o \
-o pgmodule.so
-----------------------------------------
ldd /usr/lib/python1.5/lib-dynload/pgmodule.so
statically linked
Wayne suggested that I change the line beginning with pgmodule.so to
pgmodule.so: pgmodule.o
$(GCC) -shared -o pgmodule.so pgmodule.o -lpq
However, the compiler complained about a missing separator when I do that.
I then tried
pgmodule.so: pgmodule.o
ld -G -shared pgmodule.o \
-o pgmodule.so -lpq
It compiled successfully and the result of ldd was:
ldd /usr/lib/python1.5/lib-dynload/pgmodule.so
libpq.so.1 => /usr/lib/libpq.so.1 (0x4000a000)
libc.so.6 => /lib/libc.so.6 (0x40015000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
When I tried to run it:
from pg import *
ImportError: /usr/lib/libpq.so.1: undefined symbol: crypt
At least I am having some progress.
Thanks for your interest.
Johann.
--------------------------------------------------------------------------
| Johann Spies Windsorlaan 19 |
| jhspies@alpha.futurenet.co.za 3201 Pietermaritzburg |
| Tel/Faks Nr. +27 331-46-1310 Suid-Afrika (South Africa) |
--------------------------------------------------------------------------
"Seeing then that all these things shall be dissolved,
what manner of persons ought ye to be? You ought to
live holy and godly lives as you look forward to the
day of God and speed its coming."
II Peter 3:11,12
Reply to: