Unexpected exit when use Visual Studio 2022
- Linguagem predominante
- C++
- Estrelas
- 537
- Forks
- 223
- Merge médio
- 11h 22min
- PRs com merge (30d)
- 2
Descrição
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);
}
```


This is my Visual Studio 2022 Config:



Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Start with dllmain.cpp and the Visual Studio 2022 configuration shown in the issue, then reproduce the vcpkg-built Boost.Python extension by importing Dll1. Check the build and runtime configuration around the DLL import, and consider the issue complete when importing the DLL no longer exits Python and test() can be called.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- cpp, python
- Domínio
- backend
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 30/100