How to fix"temp\ccSZ9gCR.o....undefined reference to `_imp__Py_Initialize' Error?
I use MinGW to compile a c++ file, which includes <python.h>
.
g++ -Ic:\ProgramData\Anaconda3\include test.cpp
It returns the error temp\ccSZ9gCR.o....undefined reference to `_imp__Py_Initialize'
How can I fix it?
p.s. ,I want to embed python in C++.At first,I guess I should use -I -L to add some directories to be included in. I changed the g++ comand as this:
g++ -Ic:\ProgramData\Anaconda3\include -Lc:\ProgramData\Anaconda3\libs test.cpp
In libs directory, there are python3.lib and python37.lib files. But I still got the same error result.