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?
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
.
Have you tried switching the order of the includes? It is possible the other header file handles things a little more gracefully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With