I'm trying to embed python script in c in windows.
#include <Python.h>
int
main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}
from the python documentation.
I'm compiling with Microsoft's lcc.
I'm getting following errors.
Error c:\lcc\examples\python\pyembed.c 7 undefined reference to __imp__Py_Initialize
Error c:\lcc\examples\python\pyembed.c 8 undefined reference to __imp__PyRun_SimpleStringFlags
Error c:\lcc\examples\python\pyembed.c 10 undefined reference to __imp__Py_Finalize
I added python include files in the project.But I'm not sure what to do with py27.lib or py27.dll.That may be the problem I guess.