So this is my first time trying to use python within a C++ program, and i am running into some problems with getting the library linked.
So i use the Code Blocks IDE with the GNU GCC compiler, and i have the following main program:
#include <Python.h> #include <iostream> using namespace std; int main() { cout<<"starting interpreter."<<endl; Py_Initialize(); PyRun_SimpleString("print 'Im in python!'"); Py_Finalize(); return 0; } and my linking settings are as follows (within code blocks GUI for compiler&debugger settings):
linker settings: link libraries: C:\Python27\libs\libpython27.a search directories: linker: C:\Python27\libs Is there something that i am missing? or am i doing this the wrong way?
Build messages:
C:\Users\users_name\Desktop\PythonIntegratedTest\main.cpp|1|error: Python.h: No such file or directory| C:\Users\users_name\Desktop\PythonIntegratedTest\main.cpp||In function 'int main()':| C:\Users\users_name\Desktop\PythonIntegratedTest\main.cpp|9|error: 'Py_Initialize' was not declared in this scope| C:\Users\users_name\Desktop\PythonIntegratedTest\main.cpp|10|error: 'PyRun_SimpleString' was not declared in this scope| C:\Users\users_name\Desktop\PythonIntegratedTest\main.cpp|11|error: 'Py_Finalize' was not declared in this scope|