I am trying to embed python in a Visual C++ application using visual studio 2017.
I correctly included the header files path and the lib path from my Python 3.7.0 installation.
I can include the Python.h and pylifecycle.h files but get an error when I try to run the program. My code and error is below.
// TestPythonEmbedding.cpp : Defines the entry point for the console application.
//
#include "Python.h"
#include "pylifecycle.h"
#include "stdafx.h"
int main()
{
PyObject* myPointer;
Py_Initialize();
return 0;
}
Here are the errors I get when I try to build the solution.
testpythonembedding.cpp(11): error C2065: 'PyObject': undeclared identifier
testpythonembedding.cpp(11): error C2065: 'myPointer': undeclared identifier
testpythonembedding.cpp(13): error C3861: 'Py_Initialize': identifier not found
1>Done building project "TestPythonEmbedding.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Strangely enough Visual studio gives information about Pyobject* and highlights it as if it is identified. I included an image of that.