当我运行我的代码时,我遇到了一个关于 boost-python 的问题。就像这样:
dyld: Symbol not found: _PyBaseObject_Type
Referenced from: /opt/local/lib/libboost_python-mt.dylib
Expected in: flat namespace
我的项目几个月前就可以正常运行了。但是现在,当我重新配置环境时,它无法运行。
-几个月前,我用homebrew配置环境,就像这样:
brew install boost
brew install python
brew install boost-python
brew install opencv(My project is an Opencv project)
-但是现在,它不起作用并且错误与上面一样。所以我使用 Macports 安装 boost,像这样:
sudo port install boost
sudo port install py27-pip
sudo port select --set python python27
sudo port select --set pip pip27
sudo port install py27-numpy
brew install opencv(The version of opencv in port is 3.0, so i use brew)
-但它有同样的问题。
谁知道如何处理这个问题?是关于boost-python的吗?我应该如何正确安装 boost-python?是关于boost/boost-python的版本吗?
最佳答案
你没有提到你的 boost 版本和/或你的编译器。但是我发现a very similar issue在 Python 的错误跟踪器上。
由于您似乎使用了 ld
链接器,因此您应该尝试将您的代码与 -Wl,--export_dynamic
链接。
关于python - 关于boost-python : dyld: Symbol not found: _PyBaseObject_Type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33094585/