It seems that some *.o file is not installed, but how can I get them?

Lu Jian Xiong jxlu at fudan.edu.cn
Tue Apr 8 21:26:26 EDT 2003


Hello,
I am a newbie of python.
When I was trying the example read from the following URL,
http://www.python.org/doc/current/ext/simpleExample.html,
it showed the following error message:

#It seems that some *.o file is not installed, but how can I get them?
#What should I do to find which RPM or tgz package they are included with?

[user0 at localhost user0]# cat spammodule.c
#include <Python.h>
static PyObject *
spam_system(self, args)
    PyObject *self;
    PyObject *args;
{
    char *command;
    int sts;

    if (!PyArg_ParseTuple(args, "s", &command))
        return NULL;
    sts = system(command);
    return Py_BuildValue("i", sts);
}
int main()
{
    return (0);
}
[user0 at localhost user0]$ gcc -I /usr/include/python2.2 spammodule.c -lpython2.2
/usr/bin/ld: cannot find -lpython2.2
collect2: ld returned 1 exit status
[user0 at localhost user0]$ gcc -I /usr/include/python2.2 -L /usr/lib/python2.2/config spammodule.c -lpython2.2
/usr/lib/python2.2/config/libpython2.2.a(posixmodule.o): In function `posix_tmpnam':
posixmodule.o(.text+0x3977): the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/lib/python2.2/config/libpython2.2.a(posixmodule.o): In function `posix_tempnam':
posixmodule.o(.text+0x385e): the use of `tempnam' is dangerous, better use `mkstemp'
/usr/lib/python2.2/config/libpython2.2.a(complexobject.o): In function `_Py_c_pow':
complexobject.o(.text+0x37c): undefined reference to `pow'
complexobject.o(.text+0x3bc): undefined reference to `cos'
complexobject.o(.text+0x3cd): undefined reference to `sin'
complexobject.o(.text+0x3e6): undefined reference to `exp'
complexobject.o(.text+0x3f7): undefined reference to `log'
/usr/lib/python2.2/config/libpython2.2.a(floatobject.o): In function `float_pow':
floatobject.o(.text+0x138a): undefined reference to `pow'
/usr/lib/python2.2/config/libpython2.2.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':
dynload_shlib.o(.text+0x1ca): undefined reference to `dlopen'
dynload_shlib.o(.text+0x207): undefined reference to `dlsym'
dynload_shlib.o(.text+0x217): undefined reference to `dlerror'
/usr/lib/python2.2/config/libpython2.2.a(thread.o): In function `PyThread_start_new_thread':
thread.o(.text+0xb3): undefined reference to `pthread_sigmask'
thread.o(.text+0xd9): undefined reference to `pthread_create'
thread.o(.text+0xf3): undefined reference to `pthread_sigmask'
thread.o(.text+0x12a): undefined reference to `pthread_detach'
/usr/lib/python2.2/config/libpython2.2.a(posixmodule.o): In function `posix_openpty':
posixmodule.o(.text+0x17fe): undefined reference to `openpty'
/usr/lib/python2.2/config/libpython2.2.a(posixmodule.o): In function `posix_forkpty':
posixmodule.o(.text+0x188f): undefined reference to `forkpty'
collect2: ld returned 1 exit status
[user0 at localhost user0]$ slocate thread.o
[user0 at localhost user0]$ slocate python.o
/usr/lib/python2.2/config/python.o
[user0 at localhost user0]$ rpm -qa| grep ^python
python-docs-2.2.2-7
python-optik-1.3-2
python-tools-2.2.2-7
python-devel-2.2.2-7
python-2.2.2-7
[user0 at localhost user0]$ rpm -ql python-devel| grep [.]o\$
/usr/lib/python2.2/config/python.o








More information about the Python-list mailing list