[Coin-discuss] Symbol not found loading libCoinMP from Python ctypes

Miles Lubin miles.lubin at gmail.com
Sat Oct 11 14:02:20 EDT 2014


Hi Joshua,

Try adding the '--enable-dependency-linking' argument to configure.

Miles

On Fri, Oct 10, 2014 at 5:57 PM, Joshua Arnott <josh at snorfalorpagus.net>
wrote:

> Hello,
>
> I’m trying to use the CoinMP library from Python 3 via ctypes. When I try
> to load the shared library I get the following error:
>
> Python 3.4.1 (default, May 19 2014, 13:10:29)
> [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import ctypes
> >>> lib = ctypes.CDLL('libCoinMP.dylib')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/__init__.py",
> line 351, in __init__
>     self._handle = _dlopen(self._name, mode)
> OSError: dlopen(libCoinMP.dylib, 6): Symbol not found: _CbcOrClpRead_mode
>   Referenced from: /usr/local/lib/libCoinMP.dylib
>   Expected in: flat namespace
>  in /usr/local/lib/libCoinMP.dylib
>
> However, when I “make test” everything runs correctly.
>
> Output from “nm” reports the symbol is undefined:
>
> U _CbcOrClpRead_mode
>
> I am getting similar errors for the other libraries, e.g.:
>
> Python 3.4.1 (default, May 19 2014, 13:10:29)
> [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import ctypes
> >>> ctypes.CDLL('libClp.dylib')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/__init__.py",
> line 351, in __init__
>     self._handle = _dlopen(self._name, mode)
> OSError: dlopen(libClp.dylib, 6): Symbol not found:
> __ZN18CoinMessageHandler13checkSeverityEv
>   Referenced from: /usr/local/lib/libClp.dylib
>   Expected in: flat namespace
>  in /usr/local/lib/libClp.dylib
>
> Running Mac OS X 10.9.5, with current CoinMP from SVN.
>
> Kind regards,
>
> Josh
>
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20141011/5b85af22/attachment.html>


More information about the Coin-discuss mailing list