Home > Back-end >  In C BUILDER call python, link the old problems.
In C BUILDER call python, link the old problems.

Time:09-18

In c + + BUILDER call python, link the old problems,
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,
  • Related