Py_Initialize ();
The PyObject * pModule=NULL;
The PyObject * pFunc=NULL;
PModule=PyImport_ImportModule (" test ");
PFunc=PyObject_GetAttrString (pModule, "Hello");
PyEval_CallObject (pFunc, NULL);
Py_Finalize ();
/c + + Unit2. CPP (1) :
/c + + the Loaded cached pre - compiled as headers
[would]
[would Error] Unresolved external '_Py_Initialize referenced the from E: \ MYJY \ UNIT1 OBJ
[would Error] Unresolved external '_PyImport_ImportModule referenced the from E: \ MYJY \ UNIT1 OBJ
[would Error] Unresolved external '_PyObject_GetAttrString referenced the from E: \ MYJY \ UNIT1 OBJ
[would Error] Unresolved external '_PyEval_CallObjectWithKeywords referenced the from E: \ MYJY \ UNIT1 OBJ
[would Error] Unresolved external '_Py_Finalize referenced the from E: \ MYJY \ UNIT1 OBJ
CodePudding user response:
Need to take the corresponding library (python * *. Lib) added to the project,