0

I get this error: undefined symbol: _ZN5boost6python15instance_holder8allocateEP7_objectmmm which is basically undefined symbol: boost::python::instance_holder::allocate::object

How to solve that?

I am following the example for Bond in python here

It mentions all the parts needed except compiling the example.cpp

This is the my command for compilation

g++ \
-I/home/myuser/source/adhoc_experiments/python_bond_poc/real_boost/boost_1_82_0/boost/ \
-I/home/myuser/.conda/envs/archexperiments/include/python3.9/ \
-I/usr/local/include/bond/ \
\
-L/home/myuser/.conda/envs/archexperiments/lib \
-L/usr/local/lib/bond \
\
example_types.cpp \
example_apply.cpp \
example.cpp \
\
-fPIC \
-shared \
\
-lpython3 \
-lpython3.9 \
-lboost_system \
-lboost_python39 \
-lboost_thread \
-lbond \
-lbond_apply \
\
-Wl,-soname,example  -export-dynamic \
-o example.so
11
  • Try moving the boost -l lines after -lbond lines. Commented Jun 13, 2023 at 11:53
  • Your boost source seems to live under your home, but where are the corresponding libraries? Commented Jun 13, 2023 at 12:03
  • @Quimby tried that, also played around with the linked libs order a lot and still no luck Commented Jun 13, 2023 at 12:32
  • @n.m. libs at /home/myuser/.conda/envs/archexperiments/lib Commented Jun 13, 2023 at 12:34
  • 1
    When you do ldd example.so, do you get a line with /home/myuser/.conda/envs/archexperiments/lib/libboost_python39.so.1.82.0 or similar? By the way your symbol is boost::python::instance_holder::allocate(_object*, unsigned long, unsigned long, unsigned long). Commented Jun 13, 2023 at 13:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.