J'utilise Arch Linux. Je veux comstackr un file C ++ qui inclut <Python.h>
. Mais je ne peux pas le faire.
Dans les systèmes basés sur Debian, ce problème est résolu avec sudo apt-get install python-dev
. Comment je peux installer ce package avec pacman?
* MODIFIER *
Je ne veux pas comstackr ce file
Cc
#include "Python.h" int main(int argc, char *argv[]) { Py_SetProgramName(argv[0]); /* optional but recommended */ Py_Initialize(); PyRun_SimpleSsortingng("from time import time,ctime\n" "print 'Today is',ctime(time())\n"); Py_Finalize(); return 0; }
exécutez cette command:
g++ Cc
et j'ai cette erreur:
call_function.c:1:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated.
Vous devez comstackr vos files avec libs et cflags fournis par le package python:
gcc py.c $(pkg-config --cflags --libs python2) -o py
En outre, il devrait être #include <Python.h>
place.