我有用C++编写的代码:
#include <boost/python.hpp>
char const* greet()
{
return "Yay!";
}
BOOST_PYTHON_MODULE(libtest)
{
using namespace boost::python;
def("greet", greet);
}
Run Code Online (Sandbox Code Playgroud)
现在我想通过以下方式将此动态库导入到python:
import libtest
Run Code Online (Sandbox Code Playgroud)
但我得到:
ImportError: /usr/lib/libboost_python.so.1.54.0: undefined symbol: PyClass_Type
Run Code Online (Sandbox Code Playgroud)
我该怎么办?我的操作系统是Arch Linux.