我终于开始将Python集成到我的程序中了。我取得了不错的进步,但我(希望)打出了最后的障碍。我有以下代码(在中python_mgr.cpp):
void say_hello(const char* name)
{
std::cout << "Hello, " << name << "!" << std::endl;
}
BOOST_PYTHON_MODULE(hello)
{
def("say_hello", say_hello);
};
这工作得很好,我能够构建一个hello.pyd文件并将其导入到要使用的程序中。但是,如果我将内容更改say_hello为其他内容,例如:
void say_hello(const char* name)
{
mandala::app.exit();
}
我从得到以下输出setup.py:
running build
running build_ext
building 'hello' extension
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\boost_1_55_0 -I..\ext\glm-0.9.4.4 -IC:\Python27\include -IC:\Python27\PC /Tp../mandala/python_mgr.cpp /Fobuild\temp.win32-2.7\Release\../ma