The latest version fail to build on Cygwin
Brought to you by:
anthon
I had some issues on https://pypi.python.org/pypi/ruamel.ordereddict/0.4.9 which failed to link because of a missing declaration. However the actual version on this repository is full of errors and I cannot build orderddict.c:
Here some output:
#!bash
ordereddict.c:3750:27: error: initializer element is not constant
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
/usr/include/python2.7/object.h:85:8: note: in definition of macro ‘PyObject_HEAD_INIT’
1, type,
^
ordereddict.c:3750:5: note: in expansion of macro ‘PyVarObject_HEAD_INIT’
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
ordereddict.c:3750:27: note: (near initialization for ‘PyOrderedDictIterValue_Type.ob_type’)
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
/usr/include/python2.7/object.h:85:8: note: in definition of macro ‘PyObject_HEAD_INIT’
1, type,
^
ordereddict.c:3750:5: note: in expansion of macro ‘PyVarObject_HEAD_INIT’
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
ordereddict.c:3834:27: error: initializer element is not constant
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
/usr/include/python2.7/object.h:85:8: note: in definition of macro ‘PyObject_HEAD_INIT’
1, type,
^
ordereddict.c:3834:5: note: in expansion of macro ‘PyVarObject_HEAD_INIT’
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
ordereddict.c:3834:27: note: (near initialization for ‘PyOrderedDictIterItem_Type.ob_type’)
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
/usr/include/python2.7/object.h:85:8: note: in definition of macro ‘PyObject_HEAD_INIT’
1, type,
^
ordereddict.c:3834:5: note: in expansion of macro ‘PyVarObject_HEAD_INIT’
PyVarObject_HEAD_INIT(&PyType_Type, 0)
^
ordereddict.c:3146:18: warning: ‘dictkeys_new’ declared ‘static’ but never defined [-Wunused-function]
static PyObject *dictkeys_new(PyObject *);
^
ordereddict.c:3147:18: warning: ‘dictitems_new’ declared ‘static’ but never defined [-Wunused-function]
static PyObject *dictitems_new(PyObject *);
The most important error is:
initializer element is not constant in PyVarObject_HEAD_INIT(&PyType_Type, 0)
Please see my patches here https://github.com/nowox/ordereddict
(originally posted on 2016-09-17 at 07:53:18 by nowox <nowox@bitbucket>)
None
(originally posted on 2016-09-17 at 10:21:06 by nowox <nowox@bitbucket>)
Digging through your patches, it seems you are using gcc 5.4.0 and Python 2.7.10. What version of Windows?
I think the gcc is the problem as I still use the gcc 4 series under Linux for development. I'll try to (also) use gcc 5.4 for the next update, but I have to admit the whole cygwin install and setup annoyed me as much in the past as did using Windows for development in the first place (so I might give up).
(originally posted on 2016-09-29 at 05:16:22)
I am using Windows 10 and with my patch it builds no problems. Would it be possible to pull my patch and put it on pypi ?
(originally posted on 2016-10-16 at 15:35:43 by nowox <nowox@bitbucket>)
Any news regarding this issue. I am still using my patched version. This is not convenient.
(originally posted on 2017-04-09 at 13:17:41 by nowox_ <nowox_@bitbucket>)
fix issue #6, compile on Cygwin
reported and fix proposed by nowox
→ <<cset 9ffb385dc7fa="">></cset>
(originally posted on 2017-07-23 at 11:05:42)
I had quite a few changes for 3.2/3.3 from a few years back. I merged those and after that compilation on AppVeyor seemed ok again.
I added your
from line 7 in
ordereddict.h, I think the other things are covered, but cannot test. If this solves your cygwin compile problems, then please close this issue.(originally posted on 2017-07-23 at 11:08:25)