I would like to embed Python interpreter 3.4 into a Qt 5.2.1 application (64-bit). However I'm having build issues, I mean when I include Python header in the main.cpp it compiles fine.
#include <python.h>
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
but when I put it anywhere else (after Qt headers)
//
// embedpytest.cpp
//
#include <QLibrary>
#include <python.h>
EmbedPyTest::EmbedPyTest()
{
}
I get compile errors:
C:\Python34\include\object.h:435: error: C2059: syntax error : ';'
C:\Python34\include\object.h:435: error: C2238: unexpected token(s) preceding ';'
It's very similar problem to this one, but the solution is not working
Anyone knows how to solve this issue ? or suggest some clean workaround so that python.h and Qt5 can live together happily ever after ?