About boost-python: dyld: Symbol not found: _PyBaseObject_Type
Asked Answered
S

1

6

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?

Sanborne answered 13/10, 2015 at 5:11 Comment(1)
Did you ever solve the problem? I am facing exactly the same issue.Elboa
L
3

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.

Log answered 30/4, 2016 at 20:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.