T
T
Trimsky2020-11-19 06:21:57
Python
Trimsky, 2020-11-19 06:21:57

Where to download Python.h and PyObject?

I am trying to run Python in C.
I don't understand where to connect Python.h, code:

#include <Python.h>

int main() {
    // Загрузка интерпретатора Python
    Py_Initialize();
    // Выполнение команды в интерпретаторе
    PyRun_SimpleString("print('Hello!')");
    // Выгрузка интерпретатора Python
    Py_Finalize();
}

This code does not find All functions.
Mistake:
File.c:(.text+0x5): undefined reference to `Py_Initialize'
/usr/bin/ld: File.c:(.text+0x16): undefined reference to `PyRun_SimpleStringFlags'
/usr/bin/ld: File.c:(.text+0x1b): undefined reference to `Py_Finalize'

So where can I download Python.h?
C code.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-11-19
@Trimsky

Install Python sources. How exactly this is done depends on the operating system you are using.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question