You are not logged in.
Good day everyone.
A problem emerged after my update yesterday.
I have some code which includes:
#include <boost/python.hpp>
but compilation stops with this error:
/usr/include/bits/fcntl.h:227: error: reference to 'ssize_t' is ambiguous
/usr/include/sys/types.h:110: error: candidates are: typedef __ssize_t ssize_t
/usr/include/boost/python/ssize_t.hpp:15: error: typedef Py_ssize_t boost::python::ssize_t
/usr/include/bits/fcntl.h:227: error: reference to 'ssize_t' is ambiguous
/usr/include/sys/types.h:110: error: candidates are: typedef __ssize_t ssize_t
/usr/include/boost/python/ssize_t.hpp:15: error: typedef Py_ssize_t boost::python::ssize_t
/usr/include/bits/fcntl.h:227: error: 'ssize_t' does not name a type
I am using arch64 (I hope it is ok to post here and not on the arch64 forum) with everything up to date as of today, March 30.
I have tried recompiling boost but that did not fix the problem.
The origin seems to be this line in /usr/include/boost/python/ssize_t.hpp:
typedef Py_ssize_t ssize_t;
which refreneces to this line in /usr/include/sys/types.h
typedef __ssize_t ssize_t
but as the error says, ssize_t seems not to be a type.
IYO should I file a bug?
Thank you for any help you can provide
Valerio
Abyone else experienced the same problem?
Offline
Yeah this is a 64 bit issue. Andy added a Mandriva based patch to fix this in our cvs:
http://cvs.archlinux.org/cgi-bin/viewcv … root=Extra
Offline
Thank you phrakture for you help.
I have already recompiled boost with ABS, which applies the patch.
I think that the patch is designed to make *boost* compile fine. Boost compiles fine on my machine now.
Instead I have problems with programs that *include* boost headers. I cannot compile those!
As I said when I include the boost python header, a cascade of include ends up including the header that causes the error.
As you can notice from the error, the problem seems not to be in our code, but in usr/include/boost/python/ssize_t.hpp, which belongs to the package "boost", and in types.h which belong to the package "glib". While I don't fully understand the problem, it seems to me that the include file in boost treats ssize_t as a type while according to glib it is not. When the headers are included, the error happens.
Valerio
Offline
I think I have insulated the origin of the problem and a potential solution.
The problem lies in the fact that ssize_t is declared twice, one in
/usr/include/sys/types.h: typedef __ssize_t ssize_t
and one in
/usr/include/boost/python/ssize_t.hpp: typedef Py_ssize_t boost::python::ssize_t
If I just comment out the line in /usr/include/boost/python/ssize_t.hpp:
#if PY_VERSION_HEX >= 0x02050000
- typedef Py_ssize_t ssize_t;
+ //typedef Py_ssize_t ssize_t;
ssize_t const ssize_t_max = PY_SSIZE_T_MAX;
ssize_t const ssize_t_min = PY_SSIZE_T_MIN;
#else
That leaves only one declaration and resolves the ambiguity. My code now compiles
I filed a bug report with all these notes.
Thank you for your help!
Valerio
Offline