Still no luck - PLease help!!
Thomas A. Bryan
tbryan at python.com
Thu Oct 19 08:05:44 EDT 2000
John Draper wrote:
> trying to compile the "crypt" module
> into my Python system.
> build output...
> `add2lib' is up to date.
> `add2lib' is up to date.
> `add2lib' is up to date.
> `add2lib' is up to date.
> expr `cat buildno` + 1 >buildno1
> mv -f buildno1 buildno
> gcc -c -g -O2 -I. -DHAVE_CONFIG_H -DBUILD=`cat buildno`
> ./Modules/getbuildinfo.c
> ar cr libpython1.5.a getbuildinfo.o
> ranlib libpython1.5.a
> true
> cd Modules; make OPT="-g -O2" VERSION="1.5" prefix="/usr/local"
> exec_prefix="/usr/local" LIBRARY=../libpython1.5.a link
> cc python.o ../libpython1.5.a -L/usr/local/pgsql -lpq -lm -o python
> ld: -lpq: no match
> collect2: ld returned 1 exit status
> *** Error code 1
This has nothing to do with libcrypt and everything to do with Postgresql.
Are you also trying to add Postgresql support to your Python? If so, you
probably need to change the -L option to /usr/local/pgsql/lib or
/usr/local/lib. To briefly explain what's going on...
The cc command is trying to link a bunch of C object files together to form
an executable. The -lpq option tells it that it can use libpq.so or libpq.a,
to find any missing symbols. The -L/usr/local/pgsql tells it that it can
look in the /usr/local/pgsql for libpq.so or libpq.a if it can't find the
library in the standard places (probably just /usr/lib). The error says that
the -lpq option was given but no libpq.so or libpq.a was found. You probably
just need to adjust the -L option. For example, if libpq.so is in
/usr/local/pgsql/lib/libpq.so, then use -L/usr/local/pgsql/lib.
Then recompile Python, probably from scratch (first run "make distclean")
so that you get a clean build. On a Red Hat system, adding crypt to the
Python interpreter is as simple as putting/uncommenting this line in
Modules/Setup (or, better, putting it in a file called Modules/Setup.local).
crypt cryptmodule.c -lcrypt
You'll probably want to make sure that /usr/lib/libcrypt.a is part on your
system. It should be part of the glibc-devel package.
---Tom
> I took the virgin copy of the 1.5.2 distribution.... the only bummer was
> that it had originally compiled jusst fine on this machine, but now I
> get this error....
>
> First, I tried to add the "crypt cryptmodule.c -lcrypt" line to the
> setup file. Of course I wasn't sure of how or where to add the -lcrypt
> options, so I added it at the end. Of course it didn't work...
> and I got the link error above.... Next I tried to build it without the
> -lcrypt option, and THAT didn't work.... and now here's the REAL
> clincher and puzzler... I changed the "Setup" file back the exact same
> as it was... and THEN I tried to rebuild it, and I get the exact same
> problem - ANd I get it on BOTH OpenBSD boxes... Can ANYONE out there
> please help me?
>
> I've been struggling with this for over a week, I feel I've been
> "punished" enough....
>
> Patiantly awaiting a reply...
>
> John
More information about the Python-list
mailing list