Category : boost-python

I’m trying to wrap my C++ library with boost-python. However, I’m running into trouble getting the program to run when I try to add boost-python (it is able to compile). When the program runs, it throws the following error: dyld: Symbol not found: _PyBaseObject_Type Referenced from: /usr/local/opt/boost-python3/lib/libboost_python39-mt.dylib Expected in: flat namespace in /usr/local/opt/boost-python3/lib/libboost_python39-mt.dylib I made ..

Read more

I am looking for a way to iterate through python dict (without creating tmp list object). After some little research I came to this. boost::python::object dictItemsView(const boost::python::dict& dict) { #if PY_MAJOR_VERSION >= 3 return dict.items(); #else return dict.iteritems(); #endif } template <typename Func> void iterDict(const boost::python::dict& dict, Func func) { boost::python::handle<> iterH(boost::python::allow_null<>(PyObject_GetIter(dictItemsView(dict).ptr()))); if (!iterH.get()) { ..

Read more

I’m trying to create boost python module and test producer & consumer problem. But I faced some error and problems… Below image shows my goal architecture. I implemented boost python module (github) and here is python code snippet (main.py) import threading import datetime import PyDataTest queue = None def thread_function(): print(‘[thread_function] start…’) while True: print(‘[thread_function] ..

Read more