c++ - boost python on windows crashes at import("__main__"); -
I am rewriting a program that uses an embedded booth python on my program Linux mint no problem It does, but it's a big pain on Windows. I'm using Mingwood, so I tried to make an import lube according to the instructions given on another site on this site. Keeping everyone in mind, the program is compiled and linked, python34 promotes dynamically and python steadily. My program crashes and I tell my life why, I follow the execution and it prevents: "Import (" Main ");"
// My Python extension PyImport_AppendInittab ("OpenGL", PyInit_OpenGL); PyImport_AppendInittab ("glm", PyInit_glm); PyImport_AppendInittab ("glfw", PyInit_glfw); Cout & lt; & Lt; "Starting python ..."; Py_Initialize (); Cout & lt; & Lt; "Complete \ n"; Namespace Promotion: Using Python; Main_module = import ("__ main__"); // & lt; This line crashes on main_namespace = main_module.attr ("__ dict__"); Magically enough I removed libpython34.a from my lib search path and the program still made fine, so I think the problem may not really be with Python, but I'm out of the idea of looking for this issue I can not get any detailed information about the error, due to which the program is finished in the program and nothing imprints, and I have errors There are exceptions to getting error_already_set: / If you have any suggestions or really share anything please thank you! Edit: I have created the Hello World embedded program for this simple python
PyImport_ImportModule ("__ main__"); PyRun_SimpleString ("Time import time, ctime \ n" "print ('is today', ctime (time ()) \ n)"); Py_Finalize ();
This works by flares on the other side:
boost :: python :: import ("__ main__");
A silent accident occurred.
Comments
Post a Comment