Reputation: 123
I want to embedded python code in Qt C++ code. I create a console Qt app for test.
My .pro
is
SOURCES += main.cpp
LIBS = -lboost_python -lpython27
HEADERS += /usr/include/python2.7
My main.cpp
file is
#include <QCoreApplication>
#include <boost/python.hpp>
using namespace boost::python;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
return a.exec();
}
But I found I can't build this program.
error message is:
/usr/include/boost/python/detail/wrap_python.hpp:50:
Error:pyconfig.h: No such file or directory
I googled this problem, but havn't got answer.
How to configure Qt I want embedded Python code in My Qt C++ program?
Upvotes: 1
Views: 1555
Reputation:
You must install python developer package at first.
In Ubuntu you can use apt-get
as the following:
apt-get install python2.7-dev
Upvotes: 1