Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About boost-python: dyld: Symbol not found: _PyBaseObject_Type

When I run my code, I meet a problem about boost-python. Just like this:

dyld: Symbol not found: _PyBaseObject_Type
Referenced from: /opt/local/lib/libboost_python-mt.dylib
Expected in: flat namespace

My project could run correctly several months ago. But now, when I reconfigure the environment, it can not run.

-Severals months ago, I used homebrew to configure the environment, just like this:

brew install boost
brew install python
brew install boost-python
brew install opencv(My project is an Opencv project)

-But now, it doesn't work and the error is just like above. So I use Macports to install boost, like this:

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 it has the same problem.

Who knows how to deal with this problem? Is it about the boost-python? How should I to install boost-python correctly? Is it about the version of boost/boost-python?

like image 240
user5439267 Avatar asked Oct 13 '15 05:10

user5439267


1 Answers

You didn't mention your boost version and/or your compiler. But I found a very similar issue on the Python's bug tracker.

As you seem to use the ld linker, you should try to link your code with -Wl,--export_dynamic.

like image 179
cromod Avatar answered Nov 18 '22 20:11

cromod