Skip to content Skip to sidebar Skip to footer

Embedding Python: Undefined Reference To `_imp__py_initialize'

I am trying to embed python 3.7.0 in a C++ application and use MinGW to compile. #include 'Dependencies/include/Python.h' int main() { PyObject* myPointer; Py_Initialize

Solution 1:

EDIT: Found and Answer:

The path to the python libs file needs to be included. I personally am now using Visual Studio and just included it in the settings but I think MinGW can do it with some command line adjustments.

include something similar to this in library paths. C:Local\Programs\Python\Python37\Lib

Solution 2:

You need to build with Python headers:

g++ TestEmbedding.cpp `python3-config--includes` -o TestEmbedding

Post a Comment for "Embedding Python: Undefined Reference To `_imp__py_initialize'"