Adding Python to C++: not finding Python.h -
i want add functions written in python c++ program:
#include <iostream> #include <python.h> using namespace std; int main(){ int = 0; cout << a; return 0; }
but when compile program using commend g++ main.cpp -wall -o main
have error: fatal error: python.h: no such file or directory
i trying solve problem installing python2.7 -dev
sudo apt-get install python2.7-dev
, didn't help. can suggest more can fix problem?
you need tell compiler find python headers. example, on systems you'd this:
g++ -i /usr/include/python2.7 ...
Comments
Post a Comment