how to import extension module from embedding application on aix5

Z

zhang xiaoning

Hi,

I download and extract python-2.4.2 source code for unix, and then, build
and install it on aix5, the configure option I used is:
../configure --enable-shared --disable-ipv6 --prefix=/usr/python
then, I run:
make
and
make install

because I want to embed python in other language, so I continue run:
make libpython2.4.so
then,run make install again.

after works above, I start python, try:
import time
print time.localtime()
every thing is okay.

and then, I try a simple example: import.c
#include <Python.h>
int
main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("import time\n"
"print time.localtime()\n");
Py_Finalize();
return 0;
}

the Makefile is like:
cc_r -c -I. -o ./import.o import.c $(PYINC).
cc_r -o ./importApp ./import.o -brtl $(LIBPATH) -lpython2.4
where PYINC and LIBPATH are correct.

I got the importApp, I try to run it:
../importApp
I got an error message:
ImportError: Exec format error

I test most of extension module which is in
<python_home>/lib/python2.4/lib-dynload, such as math, parser, I got the
same error.

It seems due to try to import extension module from embedding application.
Any thing wrong I did when I configure and make install python?

Thank you!

Xiaoning
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top