Open linjiahao962889027 opened 2 years ago
I installed boost Python on Windows using vcpkg. And I successfully compiled my DLL file, but I don't know why Python always exits automatically after import the dll. This is my code (dllmain.cpp):
// dllmain.cpp : 定义 DLL 应用程序的入口点。 #include "pch.h" #include <iostream> #include <string> #define BOOST_PYTHON_STATIC_LIB #include <boost/python.hpp> using namespace boost::python; void test() { std::cout << "Test" << std::endl; } BOOST_PYTHON_MODULE(Dll1) { boost::python::def("test", test); }
This is my Visual Studio 2022 Config:
I installed boost Python on Windows using vcpkg. And I successfully compiled my DLL file, but I don't know why Python always exits automatically after import the dll. This is my code (dllmain.cpp):
This is my Visual Studio 2022 Config: