当我运行我的代码时,我遇到了一个关于boost-python的问题。就像这样:
dyld: Symbol not found: _PyBaseObject_Type
Referenced from: /opt/local/lib/libboost_python-mt.dylib
Expected in: flat namespace我的项目几个月前就可以正常运行了。但是现在,当我重新配置环境时,它不能运行。
-Severals几个月前,我使用自制软件来配置环境,就像这样:
brew install boost
brew install python
brew install boost-python
brew install opencv(My project is an Opencv project)-But现在,它不工作,错误就像上面一样。所以我使用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)-But它也有同样的问题。
谁知道如何处理这个问题呢?是关于boost-python的吗?如何正确安装boost-python?是关于boost/boost-python的版本吗?
发布于 2016-05-01 04:09:58
您没有提到您的boost版本和/或编译器。但我在Python的bug跟踪器上找到了a very similar issue。
由于您似乎在使用ld链接器,因此应该尝试使用-Wl,--export_dynamic链接您的代码。
https://stackoverflow.com/questions/33094585
复制相似问题