c++ namespace collision with gtest and boost

boost, c++, googletest

Solution

Try building with `BOOST_HAS_TR1_TUPLE` defined. It looks like both boost and your `std` libraries are defining `std::tr1::tuple` and I can't see how to disable the `std` version. Looking at the boost header though it appears that `BOOST_HAS_TR1_TUPLE` needs to be defined to tell boost that `std::tr1::tuple` is already defined.

I got similar errors to yours when I tried to compile a file including both those headers and then they disappeared when I defined `BOOST_HAS_TR1_TUPLE`.

Problem

If I include both gtest/gtest.h and boost/math/distributions/poisson.hpp I get ``` /opt/local/include/boost/tr1/tuple.hpp:63: error: ‘tuple’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:67: error: ‘make_tuple’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:68: error: ‘tie’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:72: error: ‘tuple_size’ is already declared in this scope /opt/local/include/boost/tr1/tuple.hpp:73: error: ‘tuple_element’ is already declared in this scope ``` How do I prevent these two library namespaces from colliding?

Original source