Python Forum
Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to Compile Demo
#1
I am attempting to call some CPP code from Python2.7. There is an example of this located inside the Python directory (C:\Python27\Demo\embed). When I attempt to use the makefile (using Cygwin) in that folder I am unable to build. I have not modified the makefile yet and unsure what to edit if I am using gcc as my compiler and dont know if I should change the blddir.

Here are the errors I am getting:

../../Include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."

In file included from ../../Include/Python.h:86:0,
from demo.c:3:
../../Include/intobject.h:46:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyInt_AsUnsignedLongLongMask’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);

../../Include/pyconfig.h:302:23: error: unknown type name ‘__int64’
# define PY_LONG_LONG __int64

In file included from ../../Include/Python.h:88:0,
from demo.c:3:
../../Include/longobject.h:53:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyLong_AsUnsignedLongLong’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
^
../../Include/longobject.h:54:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyLong_AsUnsignedLongLongMask’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
^
In file included from ../../Include/Python.h:58:0,
from demo.c:3:
../../Include/pyconfig.h:302:23: error: unknown type name ‘__int64’
# define PY_LONG_LONG __int64

Please let me know if you have any advice for me!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding Decimals to classes with OOP + rounding to significant digits (ATM demo) Drone4four 7 2,314 May-04-2022, 06:15 AM
Last Post: Drone4four
  demo not running for me - getting keyError wolf8963 4 3,459 Feb-13-2020, 03:54 PM
Last Post: wolf8963
  Help! Turtle not working, even when we click the turtle demo in IDLE nothing happens. BertyBee 3 5,649 Jan-04-2019, 02:44 AM
Last Post: SheeppOSU
  Can't access Turtle Demo beeo 4 6,097 Aug-12-2018, 01:39 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020