embedding python
Anand K Rayudu
anand at easi.soft.net
Tue Feb 3 04:10:27 EST 2004
William Park wrote:
>Anand K Rayudu <anand at easi.soft.net> wrote:
>
>
>>Hi All,
>>
>>I have one problem with embedding python into my application.
>>on HP-UX11 i created my application with linking libPython2.3.a
>>And with my product i supply all extension dlls [ .so] and with
>>appropriate PYTHONHOME and PYTHONPATH set.
>>
>>Every thing is fine till i import math,
>>When i import math [ For all extension modules ]
>> I get following error.
>> import math
>>ImportError: dynamic module does not define init function (initmath)
>>
>>But if i run python in shell it works fine,
>>I am sure it is some thing to do with my application linking or some
>>thing like that.
>>Could some one please suggest, how to solve this problem.
>>
>>It works fine on all other platforms.
>>I call python using 'PyRunSimpleFile' Function.
>>
>>Thanks in advance.
>>
>>Anand
>>
>>
>
>Did you compile with '-lm' ?
>Eg:
> http://home.eol.ca/~parkw/index.html
>Hi William,
>
Thanks for the help, I compiled with -lm , It did not work!!
Probably i need to re-compile python with -DEMBED_PYTHON option as you
suggested.
As the python error suggests, it could load the dynamic library, but
could not find 'initmath' symbol in the library.
looks like '_PyImport_GetDynLoadFunc' function is failing.
And i also see following define. I am hoping this gives some info to
solve the issue.
#if defined(__hp9000s300)
#define FUNCNAME_PATTERN "_init%.200s"
#else
#define FUNCNAME_PATTERN "init%.200s"
#endif
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040203/5c3cbd95/attachment.html>
More information about the Python-list
mailing list