Error with GCC and TR1 (error: no include path in which to search for tr1/type_traits)
Hi, I'm using GCC 4.4 with Boost 1.40, and I've recently came across a library which uses tr1/tuple. The problem I'm running into now is that I include <boost/tr1/tuple.hpp>, and it does not include <tr1/tuple>, but rather pulls in the Boost implementation -- which gives me compile errors like /usr/include/boost/tr1/tuple.hpp:63: error: ‘tuple’ is already declared in this scope /usr/include/boost/tr1/tuple.hpp:72: error: ‘tuple_size’ is already declared in this scope /usr/include/boost/tr1/tuple.hpp:73: error: ‘tuple_element’ is already declared in this scope So I'd really like to pull in the TR1 implementation from the compiler, to avoid these collisions. In order to fix this, I tried to define BOOST_HAS_GCC_TR1 as specified in the docs -- without success, I'm getting now /usr/include/boost/tr1/type_traits.hpp:13:49: error: no include path in which to search for tr1/type_traits As described in the docs, I added several more defines: DBOOST_HAS_GCC_TR1 BOOST_TR1_DISABLE_INCLUDE_NEXT=1 BOOST_TR1_GCC_INCLUDE_PATH=/usr/include/c++/4.4/ without success, I'm still getting the "no include path" error. I'm using the system boost, which is installed in /usr/include/boost; and I'd really like to keep using it. Is there any other way to force Boost to pick up the compiler's TR1 library? Cheers, Anteru
Anteru wrote about including GCC's TR1 tuple:
So I'd really like to pull in the TR1 implementation from the compiler, to avoid these collisions. In order to fix this, I tried to define BOOST_HAS_GCC_TR1 as specified in the docs -- without success, I'm getting now /usr/include/boost/tr1/type_traits.hpp:13:49: error: no include path in which to search for tr1/type_traits
As described in the docs, I added several more defines: DBOOST_HAS_GCC_TR1 BOOST_TR1_DISABLE_INCLUDE_NEXT=1 BOOST_TR1_GCC_INCLUDE_PATH=/usr/include/c++/4.4/
without success, I'm still getting the "no include path" error. I'm using the system boost, which is installed in /usr/include/boost; and I'd really like to keep using it. Is there any other way to force Boost to pick up the compiler's TR1 library?
I think this is the bug I found two months ago. The macro BOOST_TR1_DISABLE_INCLUDE_NEXT is not being checked when it should be. The workaround is to explicitly undefine BOOST_HAS_INCLUDE_NEXT before including boost/tr1/tuple.hpp, like so: #define BOOST_HAS_TR1_TUPLE 1 #include <boost/tr1/detail/config.hpp> #undef BOOST_HAS_INCLUDE_NEXT #include <boost/tr1/tuple.hpp> Here's my post about the issue, and the response from John Maddock announcing a patch: http://old.nabble.com/-TR1--Using-Boost.TR1-installed-in--usr-include-with-G... -- Anthony Foglia Princeton Consultants (609) 987-8787 x233
participants (2)
-
Anteru
-
Anthony Foglia