Hello, Im trying to link python for execute this code:
I linked 'python\include' and 'python\libs\', anyone how what I can do?
Im using Codeblocks and MinGW.
Код:
#include <Python.h>
int main(int argc, char *argv[])
{
Py_SetProgramName((wchar_t *)argv[0]); /* optional but recommended */
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print('Today is', ctime(time()))\n");
Py_Finalize();
return 0;
}
Код:
But I got this error:
||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\Users\xxxxxxxxxxxxxxxxxxxxxx\test\test\main.cpp|5|undefined reference to `__imp_Py_SetProgramName'|
C:\Users\xxxxxxxxxxxxxxxxxxxxxx\test\test\main.cpp|6|undefined reference to `__imp_Py_Initialize'|
C:\Users\xxxxxxxxxxxxxxxxxxxxxx\test\test\main.cpp|8|undefined reference to `__imp_PyRun_SimpleStringFlags'|
C:\Users\xxxxxxxxxxxxxxxxxxxxxx\test\test\main.cpp|9|undefined reference to `__imp_Py_Finalize'|
||error: ld returned 1 exit status|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
I linked 'python\include' and 'python\libs\', anyone how what I can do?
Im using Codeblocks and MinGW.