dynamic loading error ("Symbol not found")
Ned Deily
nad at acm.org
Sat Oct 16 21:30:34 EDT 2010
In article <i9d4m9$5fu$1 at reader1.panix.com>, kj <no.email at please.post>
wrote:
> The following interaction (in OS X) summarizes the situation:
>
> % echo $DYLD_LIBRARY_PATH
> /Applications/MATLAB_R2010a.app/bin/maci64
> % grep -r _engClose $DYLD_LIBRARY_PATH
> Binary file /Applications/MATLAB_R2010a.app/bin/maci64/libeng.dylib matches
> % export DYLD_LIBRARY_PATH
> % python
> Python 2.6.5 (r265:79063, May 22 2010, 18:34:46)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from mlabwrap import mlab
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "mlabwrap.py", line 188, in <module>
> import mlabraw
> ImportError:
> dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2
> .6/site-packages/mlabrawmodule.so, 2): Symbol not found: _engClose
> Referenced from:
> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/si
> te-packages/mlabrawmodule.so
> Expected in: dynamic lookup
>
> >>>
>
> In summary,
>
> 1) dlopen produces a "Symbol not found: _engClose" error;
> 2) according to grep, a file accessible through the variable
> DYLD_LIBRARY_PATH matches the string "_engClose";
>
> The permissions of the file in question are all OK (0555); likewise,
> the permissions of all the prefix subpaths leading to this file
> are fine.
>
> (For all I know, it is possible that, even though the libeng.dylib
> file matches "_engClose", this is only a fragment of a longer symbol
> name.)
>
> Can anyone suggest a way to fix this error?
I'd suspect an architecture mismatch or ABI mismatch. The "maci64" in
the path suggests to me that libeng.dylib might be a 64-bit-only library
while the framework path and the fact that the (presumably
MacPorts-derived) Python you are using was built with gcc 4.0.1 suggests
you are running on OS X 10.5 or 10.4 and the python installation is
32-bit only. That is easy enough to check: use `/usr/bin/file` and
`/usr/bin/otool -L` on mlabramodule.so and lilbeng.dylib.
--
Ned Deily,
nad at acm.org
More information about the Python-list
mailing list