Running python script in cpp [closed]
I'm trying to run a python script inside a cpp file but it doesn't recognise the python library: fatal error: Python.h: No such file or directory.
I'm including the library in the makefile like this: ${PYTHON_INCLUDE_DIRS}
Any idea what might be missing?
char filename[] = "/scripts/arm_activate.py";
FILE* fp;
Py_Initialize();
fp = _Py_fopen(filename, "r");
PyRun_SimpleFile(fp, filename);
Py_Finalize();
I closed your question because it seems like it's more of a C++ problem instead of a ROS-related problem. If you update it to be a ROS-related problem then we reopen it. With over 57,000 questions on the site we try to keep them focused on issues related to ROS