1

I am using eclipse and cygwin gcc compiler. Trying to use the Python.h for my C program but encounter these errors when compiling. Any ideas?

In file included from C:/Python27/include/python.h:86,
                 from ../src/EmbeddedPython.c:13:
C:/Python27/include/intobject.h:45: error: parse error before "PyInt_AsUnsignedLongLongMask"
C:/Python27/include/intobject.h:45: warning: type defaults to `int' in declaration of `PyInt_AsUnsignedLongLongMask'
C:/Python27/include/intobject.h:45: warning: data definition has no type or storage class
In file included from C:/Python27/include/python.h:88,
                 from ../src/EmbeddedPython.c:13:
C:/Python27/include/longobject.h:49: warning: parameter names (without types) in function declaration
C:/Python27/include/longobject.h:51: error: parse error before "PyLong_AsLongLong"
C:/Python27/include/longobject.h:51: warning: type defaults to `int' in declaration of `PyLong_AsLongLong'
C:/Python27/include/longobject.h:51: warning: data definition has no type or storage class
C:/Python27/include/longobject.h:52: error: parse error before "PyLong_AsUnsignedLongLong"
C:/Python27/include/longobject.h:52: warning: type defaults to `int' in declaration of `PyLong_AsUnsignedLongLong'
C:/Python27/include/longobject.h:52: warning: data definition has no type or storage class
C:/Python27/include/longobject.h:53: error: parse error before "PyLong_AsUnsignedLongLongMask"
C:/Python27/include/longobject.h:53: warning: type defaults to `int' in declaration of `PyLong_AsUnsignedLongLongMask'
C:/Python27/include/longobject.h:53: warning: data definition has no type or storage class
C:/Python27/include/longobject.h:54: error: parse error before "PyLong_AsLongLongAndOverflow"
C:/Python27/include/longobject.h:54: warning: type defaults to `int' in declaration of `PyLong_AsLongLongAndOverflow'
C:/Python27/include/longobject.h:54: warning: data definition has no type or storage class
make: *** [src/EmbeddedPython.o] Error 1
1
  • 1
    Looks like you need some more includes. Commented Nov 9, 2011 at 15:04

1 Answer 1

2

I don't know if this would help you out or not, but using gcc on OS X to compile a C program with embedded Python I had to link to the Python library. For instance from the command line I compiled:

gcc python_test.c -lpython2.7 -o python_test

where -l is the flag and python2.7 is my Python library folder.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.