[capi-sig] Some problem when i use Python C/API to embed python script, need Help......

zouxianjun 45728 zouxianjun at huawei.com
Mon Jan 5 08:08:13 CET 2009


when the program run as exe, everything goes right, but if i compile the program as a .so lib, use other program to load the .so lib and run, it goes wrong,in the lib i also use PyRun_SimpleString("import base64"); it goes wrong.....my python version is 2.3, i want to know what's the problem...... PyErr_Print() print the error info 
below:
Traceback (most recent call last):
  File "./myModule111.py", line 3, in ?
    import base64
  File "/usr/lib/python2.3/base64.py", line 7, in ?
    import binascii
ImportError: /usr/lib/python2.3/lib-dynload/binascii.so: undefined symbol: PyExc_TypeError

i check the binascii.so, ldd -r binascii.so, this lib really has many undefined symbols include PyExc_TypeError, but the problem is when the program is executable, it can goes fine...... 

when i compile the program as .so lib, i add  -Xlinker -export-dynamic, it doesn't solve the problem.........


******************************************************************************************
 This email and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained here in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email
 immediately and delete it!
 *****************************************************************************************


More information about the capi-sig mailing list