My C code:
#include<stdio.h>
#include "Python.h"
int main()
{
printf("Hello World");
return 0;
}
I have python-dev
installed for python2.7. Moreover, Python.h
is available in /usr/include/python2.7
.
gcc myfile.c
# Python.h: No such file or directory
I even tried :
gcc -L/usr/include/python2.7/ myfile.c
# Python.h: No such file or directory
I tried building a python c module ujson
with pip that uses Python.h
, it was able to compile.
What am I missing / doing wrong ?
It should be -I
, not -L
:
gcc -I/usr/include/python2.7 myfile.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With