I needed to compile a C-Programm that uses the Python.h
to call a Python-Method from an existing Python-File.
And all that on a Windows 10 machine with MinGW
.
As I could not find a straight-up answer on what compile command I need, I will now post what works for me in the hope it helps others too!
The command that worked for me is as follows:
gcc -o nameOfexe nameOfCFile.c -I PathToPython\include -L PathToPython\libs -lpythonXX
Explanation:
Both the C-File and the Python-File are in the same Folder I run the command in.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.