error: conflicting declaration of ‘int _PyUnicode_ToLowerFull(Py_UCS4, Py_UCS4*)’ with ‘C++’ linkage
I got an error while doing "pip install cyac": building 'cyac.xstring' extension x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/cyac -I/usr/include/python3.9 -c lib/cyac/xstring.cpp -o build/temp.linux-x86_64-cpython-39/lib/cyac/xstring.o lib/cyac/xstring.cpp:2043:31: error: conflicting declaration of ‘int _PyUnicode_ToLowerFull(Py_UCS4, Py_UCS4*)’ with ‘C++’ linkage 2043 | __PYX_EXTERN_C DL_IMPORT(int) _PyUnicode_ToLowerFull(Py_UCS4, Py_UCS4 *); /proto/ | ^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.9/unicodeobject.h:1026, from /usr/include/python3.9/Python.h:97, from lib/cyac/xstring.cpp:35: /usr/include/python3.9/cpython/unicodeobject.h:1103:17: note: previous declaration with ‘C’ linkage 1103 | PyAPI_FUNC(int) _PyUnicode_ToLowerFull( | ^~~~~~~~~~~~~~~~~~~~~~ error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
ERROR: Failed building wheel for cyac Failed to build cyac
my cython version is 3.0.0 python version is 3.9 gcc version is 10.2.1 system: debian:bullseye-slim
Thanks!
Setup automatically installs the latest version of Cython (3.0.0) during build. But cyac is incompatible with this version of Cython.
i got the same issue and i solved it by trying installing via modified-source instead of pip:
git clone https://github.com/nppoly/cyac.git
modify lib/cyac/xstring.cpp:2043:31
__PYX_EXTERN_C DL_IMPORT(int) _PyUnicode_ToLowerFull(Py_UCS4, Py_UCS4 *);
to
extern "C" DL_IMPORT(int) _PyUnicode_ToLowerFull(Py_UCS4, Py_UCS4 *);
then python setup.py install
cyac defines _PyUnicode_ToLowerFull in xstrings.cpp for python2 compatibility. maybe we can remove this method, and don't support python2 any more
Hi, all. I created a pull request. could you please test this version. https://github.com/nppoly/cyac/pull/20
new version is released.