boostorg / boostorg/python

Unexpected exit when use Visual Studio 2022

Abierto
#389 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
537
Forks
223
Merge medio
11 h 22 min
PR fusionados (30 d)
2

Descripción

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):
```cpp
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"

#include
#include
#define BOOST_PYTHON_STATIC_LIB
#include

using namespace boost::python;

void test() {
std::cout << "Test" << std::endl;
}

BOOST_PYTHON_MODULE(Dll1)
{
boost::python::def("test", test);
}
```
![屏幕截图 2022-07-04 164552](https://user-images.githubusercontent.com/46292984/177118025-a30fc298-f14a-4cd3-add0-ea13fe2a61cf.png)
![屏幕截图 2022-07-04 164750](https://user-images.githubusercontent.com/46292984/177119124-f13c3d88-4e5d-4a51-9ed9-0be0e6357d07.png)
This is my Visual Studio 2022 Config:
![屏幕截图 2022-07-04 164905](https://user-images.githubusercontent.com/46292984/177119173-80d57bec-6d9a-4d1f-b89a-c2cfcf08071b.png)
![屏幕截图 2022-07-04 164926](https://user-images.githubusercontent.com/46292984/177119192-e7dd9407-5cae-43bb-afbd-3c1f0ae53874.png)
![屏幕截图 2022-07-04 164952](https://user-images.githubusercontent.com/46292984/177119202-1e9bb984-2075-480f-b835-d09b2550f2ca.png)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.