Undefined boost python symbol: boost::python::detail::init_module

前端 未结 1 406
轮回少年
轮回少年 2021-01-19 10:58

I get an undefined symbol error when trying to import an extension compiled with boost python, and the symbol is one that should be included in the boost library.

I

1条回答
  •  梦毁少年i
    2021-01-19 11:33

    The undefined symbol is

    boost::python::detail::init_module(char const*, void (*)())
    

    not

    boost::python::detail::init_module(PyModuleDef&, void (*)())
    

    on http://www.boost.org/doc/libs/1_46_1/boost/python/module_init.hpp I see that the method signature has changed to the latter one in Python 3.

    You should make sure that PY_VERSION_HEX is set correctly when the boost python headers are processed.

    On my system, I see that this is e.g. defined in /usr/include/python3.1/patchlevel.h (but I had to install the python 3.1 development package first)

    0 讨论(0)
提交回复
热议问题