[C++-sig] [Boost.Python] Solaris / gcc2.95.2 wchar.h problems

David Abrahams dave at boost-consulting.com
Wed Nov 16 18:42:35 CET 2005


Jan Langer <jan at langernetz.de> writes:

> Hello,
> I read that this newsgroup is suitable for Boost.Python problems.
>
> I wanted to compile Boost 1.33.0 and I ran into problems with
> Boost.Python. My system is Solaris 5.7 with gcc 2.95.2. The Python
> version is 2.4.1. When compling the file inheritance.cpp it includes
> integer_traits.hpp which exits with an error in line 116 because
> WCHAR_MIN and WCHAR_MAX are not defined. 

You should take this up with the maintainer of the relevant part of
integer_traits.hpp.  cvs annotate shows it to be John Maddock.

1.20         (johnmadd 21-Oct-02): // These are an implementation detail and not part of the interface
1.20         (johnmadd 21-Oct-02): #include <limits.h>
1.26         (johnmadd 17-Dec-04): // we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it, 
1.26         (johnmadd 17-Dec-04): // and some may have <wchar.h> but not <cwchar> ...
1.26         (johnmadd 17-Dec-04): #if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun))
1.20         (johnmadd 21-Oct-02): #include <wchar.h>
1.20         (johnmadd 21-Oct-02): #endif

> However, my wchar.h include
> file defines those two macros. I couldn't find what was going wrong, but
> moving the include of integer_traits.hpp in inheritance.cpp to the top
> of the list of include files solves the problem. 

You can't do that. Translation units that use Python.h have to start
with a Python header, and as a consequence translation units that use
Boost.Python have to start with a Boost.Python header.  Otherwise all
heck breaks loose.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list