I built it against <b>Python 2.5.1.<br><br>compile:</b><br>gcc -c&nbsp; -I/usr/lib/python2.5/site-packages/numpy-1.0.4.0002-py2.5-linux-x86_64.egg/numpy/core/include -I/usr/bin/python/2.5.1/include/python2.5 -fPIC -fno-omit-frame-pointer -pthread -fexceptions -ansi -D_GNU_SOURCE&nbsp; -DMX_COMPAT_32 -g&nbsp; main.c<br>
<br>compile line for the other c-file is identical to main.c&#39;s<br><br><b>link:</b><br>gcc -g -pthread -shared&nbsp; main.o module.o&nbsp; -L/usr/bin/python/2.5.1/lib <b>-lpython2.5</b> -ldl -lm -lpthread -lutil -lmx -lmex -lmat -lm -lm -lstdc++<br>
<br><br><div class="gmail_quote">On Tue, Jan 13, 2009 at 12:00 AM, Michael Abshoff <span dir="ltr">&lt;<a href="mailto:michael.abshoff@googlemail.com">michael.abshoff@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Igor Sylvester wrote:<br>
<br>
Hi Igor,<br>
<div><div></div><div class="Wj3C7c"><br>
&gt; Has anyone had problems with dynamically loading PyExc_IOError when<br>
&gt; embedding a cython module?<br>
&gt; While calling init below:<br>
&gt;<br>
&gt; *in main.c:<br>
&gt; *void init {<br>
&gt; &nbsp; Py_Initialize();<br>
&gt; &nbsp; initmymodule();<br>
&gt; &nbsp; do_somethind();<br>
&gt; &nbsp; Py_Finalize();<br>
&gt; }<br>
&gt;<br>
&gt; *in module.c:*<br>
&gt; cdef public void do_something():<br>
&gt; &nbsp; &nbsp; import<br>
&gt; exceptions<br>
&gt;<br>
&gt; &nbsp; &nbsp; print exceptions.IOError # this prints &lt;type &#39;exceptions.IOError&#39;&gt;,<br>
&gt; so I don&#39;t know what to make of the error below<br>
&gt; &nbsp; &nbsp; import numpy &nbsp;# exception is thrown here, and numpy library is in<br>
&gt; pythonpath<br>
&gt;<br>
&gt; Exception:<br>
&gt; Exception exceptions.ImportError:<br>
&gt; &#39;/usr/lib/python2.5/lib-dynload/time.so: undefined symbol:<br>
&gt; PyExc_IOError&#39; in &#39;mymodule.myfunction&#39; ignored<br>
&gt;<br>
&gt; I&#39;m not yet sure which library in numpy causes the exception but this<br>
&gt; example is easy to reproduce.<br>
<br>
</div></div>How did you build the extension, i.e. did you link against python2[3|4|5] ?<br>
<br>
<br>
&gt; Thanks.<br>
&gt; Igor<br>
<br>
Cheers,<br>
<br>
Michael<br>
<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Cython-dev mailing list<br>
&gt; <a href="mailto:Cython-dev@codespeak.net">Cython-dev@codespeak.net</a><br>
&gt; <a href="http://codespeak.net/mailman/listinfo/cython-dev" target="_blank">http://codespeak.net/mailman/listinfo/cython-dev</a><br>
<br>
_______________________________________________<br>
Cython-dev mailing list<br>
<a href="mailto:Cython-dev@codespeak.net">Cython-dev@codespeak.net</a><br>
<a href="http://codespeak.net/mailman/listinfo/cython-dev" target="_blank">http://codespeak.net/mailman/listinfo/cython-dev</a><br>
</blockquote></div><br>