ImportError: dynamic module does not define module export function (PyInit_tradecpt)

2019-12-24 11:39:58 浏览数 (1)

代码语言:javascript复制
PYBIND11_MODULE(tradecpt, module){
    module.doc()="tradecpt plugin";
    pybind11::class_<tradecpy::pyTradeApi>(module, "pyTradeApi")
            .def(pybind11::init<std::map<std::string,std::string>>())
            .def("Connect", &tradecpy::pyTradeApi::Connect);
    module.def("add", &add, "A function which adds two numbers", pybind11::arg("a")=1, pybind11::arg("b")=2);
}

编译输出的文件名必须与PYBIND11_MODULE(tradecpt, module)的tradecpt保持一致

0 人点赞