LMSouq
server-admin Open

Ubuntu - Linking boost.python - Fatal error: pyconfig cannot be found

PH
Phorce
1 month ago
3 views
Problem Description
Having some issues, now I have read the following: [hello world python extension in c++ using boost?][1] [1]: https://stackoverflow.com/questions/6007185/hello-world-python-extension-in-c-using-boost I have tried installing boost onto my desktop, and, done as the posts suggested in terms of linking. I have the following code: #include <boost/python.hpp> #include <Python.h> using namespace boost::python; Now I have tried linking with the following: g++ testing.cpp -I /usr/include/python2.7/pyconfig.h -L /usr/include/python2.7/Python.h -lpython2.7 And I have tried the following as well: g++ testing.cpp -I /home/username/python/include/ -L /usr/include/python2.7/Python.h -lpython2.7 I keep getting the following error: /usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory # include <pyconfig.h> I don't know where I am going wrong. I do have boost.python installed, there's just a problem linking?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base