Note that there are some explanatory texts on larger screens.

plurals
  1. POUndefined symbol when importing Python Sybase module on OSX 10.6
    text
    copied!<p>I'm trying to get the python-sybase module working on OSX 10.6, but I've run into a bit of a snag.</p> <p>When I do</p> <pre><code>import Sybase </code></pre> <p>I get</p> <pre><code>Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "Sybase.py", line 15, in &lt;module&gt; from sybasect import * ImportError: dlopen(/Library/Python/2.6/site-packages/python_sybase-0.40pre2-py2.6-macosx-10.6-universal.egg/sybasect.so, 2): Symbol not found: _blk_alloc Referenced from: /Library/Python/2.6/site-packages/python_sybase-0.40pre2-py2.6-macosx-10.6-universal.egg/sybasect.so Expected in: flat namespace in /Library/Python/2.6/site-packages/python_sybase-0.40pre2-py2.6-macosx-10.6-universal.egg/sybasect.so </code></pre> <p>I took a look at sybasect.so, and sure enough, <code>_blk_alloc</code> is undefined. The function is located in Sybase's sybblk.dylib, which is installed, and its containing directory is in LD_LIBRARY_PATH. </p> <p>When I compiled python-sybase using <code>python setup.py build</code>, the gcc command appears to find all of the right libs correctly, but for some reason those libs don't appear to be linked after installing sybasect.so to the Python module dir.</p> <p>The gcc command is</p> <pre><code>gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc -arch x86_64 build/temp.macosx-10.6-universal-2.6/blk.o build/temp.macosx-10.6-universal-2.6/databuf.o build/temp.macosx-10.6-universal-2.6/cmd.o build/temp.macosx-10.6-universal-2.6/conn.o build/temp.macosx-10.6-universal-2.6/ctx.o build/temp.macosx-10.6-universal-2.6/datafmt.o build/temp.macosx-10.6-universal-2.6/iodesc.o build/temp.macosx-10.6-universal-2.6/locale.o build/temp.macosx-10.6-universal-2.6/msgs.o build/temp.macosx-10.6-universal-2.6/numeric.o build/temp.macosx-10.6-universal-2.6/money.o build/temp.macosx-10.6-universal-2.6/datetime.o build/temp.macosx-10.6-universal-2.6/date.o build/temp.macosx-10.6-universal-2.6/sybasect.o -L/Applications/Sybase/System/OCS-15_0/lib -lsybblk -lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl -lsybunic -o build/lib.macosx-10.6-universal-2.6/sybasect.so </code></pre> <p>The <code>-L/Applications/Sybase/System/OCS-15_0/lib</code> location is correct, and that folder contains all of the right .dylib's.</p> <p>When I run <code>otool</code> the output is:</p> <pre><code>$ otool -L build/lib.macosx-10.6-universal-2.6/sybasect.so build/lib.macosx-10.6-universal-2.6/sybasect.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) </code></pre> <p>I was expecting to see the Sybase libs in there.</p> <p>I'm a little new to linking on Mac. How do I ensure that sybasect.so references the Sybase libs? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload