Boost logo

Boost Users :

Subject: Re: [Boost-users] conflicting intmax_t definitions - Boost 1.53 and gcc 4.8 incompatibility?
From: John Maddock (john_at_[hidden])
Date: 2014-01-19 11:03:46


>I recently upgraded to Ubuntu Trusty Tehr, and now the C++ project I'm
> working on won't build.
>
> It looks like the stdlib and Boost aren't working nicely together for some
> reason. A bunch of typedefs are conflicting between the two, below is one
> of
> the errors, where intmax_t is getting defined in two places. I'm not sure
> what changed, but I now have gcc (Ubuntu/Linaro 4.8.2-14ubuntu2) 4.8.2 and
> boost Version: 1.53.0.0ubuntu2
>
> Here's an example error message:
>
> /usr/include/inttypes.h:290:8: error: reference to ‘intmax_t’ is ambiguous
> extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__
> ((__const__));
> ^
> In file included from
> /usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h:9:0,
> from /usr/include/inttypes.h:27,
> from src/uint256.h:11,
> from src/key.h:12,
> from src/crypter.h:8,
> from src/keystore.h:8,
> from src/script.h:14,
> from src/script.cpp:11:
> /usr/include/stdint.h:134:19: note: candidates are: typedef long int
> intmax_t
> typedef long int intmax_t;
> ^
> In file included from /usr/include/boost/math_fwd.hpp:12:0,
> from /usr/include/boost/math/common_factor_ct.hpp:13,
> from /usr/include/boost/variant/variant.hpp:44,
> from /usr/include/boost/variant.hpp:17,
> from src/script.h:12,
> from src/script.cpp:11:
> /usr/include/boost/cstdint.hpp:306:50: note: typedef
> boost::long_long_type boost::intmax_t
> typedef ::boost::long_long_type intmax_t;
>
>
> Any help would be much appreciated. I'm fine with downgrading something,
> I'm
> just not sure what to downgrade.... or if there's an actual fix, that's
> cool
> too.

The two types are in different namespaces so I'm not sure why the Boost one
would be found at all by GCC's headers... maybe you have a "using namespace
boost" at global scope and before your #includes are complete?

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net