Wenn ich beide Gtest/gtest.h und boost/math/Verteilungen/poisson.hpp umfassen IC++ Namespace-Konflikt mit Gtest und steigern
/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
bekommen Wie verhindere ich diese beiden Bibliothek Namespaces vom Zusammenstoß?
Das hat perfekt funktioniert. – bias
Dies hängt von der Compiler-Version und von der gtest-Version ab. GTest definiert auch ein eigenes Tupel, es sei denn, der Compiler ist gcc 4+. In diesem Fall würde Boost die gtest-Implementierung verwenden, die Sie wahrscheinlich nicht möchten. Sie können das Boost-Tupel in gtest jedoch auch verwenden, indem Sie GTEST_USE_OWN_TR1_TUPLE auf 0 setzen. – housemaister