compiling a program --with-python fails (Py_Initialize in -lpython... no)

Alex K ak42 at altavista.com
Mon Jul 23 03:30:03 CEST 2001


"M.-A. Lemburg" <mal at lemburg.com> wrote in message news:<mailman.995659022.3898.python-list at python.org>...
> Alex K wrote:
> > 
> > hello!
> > 
> > i am trying to compile a program (a module for icecast called ices)
> > with pythonsupport. but that fails.
> > 
> > i am on a slackware8 system, with python 2.2a1 installed
> > (from tarball with no special conf-arguments).
> > 
> > [root /usr/local/src/ices-0.1.0]# ./configure
> > --with-python-includes=/usr/local/include/python2.2
> > ...
> > checking for Python.h... yes
> > checking for Py_Initialize in -lpython... no
> > checking for Py_Initialize in -lpython2.0... no
> > checking for Py_Initialize in -lpython2.2... no
> > checking for Py_Initialize in -lpython1.6... no
> > checking for Py_Initialize in -lpython1.5... no
> > configure: error: Could not find the python library
> > ...
> 
> You will probably have to add the path to the Python lib
> using some configure option of that program.
> 
> A look at the config.log will also be helpful.

i have tried:
--with-python
--with-python-includes=/usr/local/include/python2.2/
--with-python-libraries=/usr/lib/python2.0/

and also:
--with-python=/usr/local/bin
--with-python-includes=/usr/local/include/
--with-python-libraries=/usr/lib/

and many combinations thereof.
nomatter what i get the abovementioned error about Py_initialize
(provided that i specify the include dir, or else it doesnt find
Python.h, which i think is strange in it self, since it is in a
standard place).

the pertinent part of config.log seems to be this (which doesnt help
me at all):
...
* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Py_Initialize();
char Py_Initialize();

int main() {
Py_Initialize()
; return 0; }
configure:3791: checking for Py_Initialize in -lpython2.2
configure:3810: gcc -o conftest -g -O2 -Wall    -fno-strict-aliasing
-I/us
r/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/lib/per
l5/i386-linux/CORE  -I/usr/local/include/python2.2/
-I/usr/local/bin/inclu
de  -L/usr/lib/python2.0/ -L/usr/local/bin/lib conftest.c -lpython2.2
-lm
-ldl  -lpthread -lshout -rdynamic  -L/usr/local/lib
/usr/lib/perl5/i386-li
nux/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/i386-linux/CORE
-lperl -
lnsl -ldl -lm -lc -lcrypt -lutil 1>&5
/usr/i386-slackware-linux/bin/ld: cannot find -lpython2.2
collect2: ld returned 1 exit status
configure: failed program was:
#line 3799 "configure"
...


line 3799 in configure is simply:
#include "confdefs.h"

that part of configure is definitely about python,
but i cant quite figure out what goes wrong and why.
anyone who has a guess?

   tia / alex k



More information about the Python-list mailing list