$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [TR1] Using Boost.TR1 installed in /usr/include with GCC
From: Anthony Foglia (AFoglia_at_[hidden])
Date: 2010-02-26 17:36:07
We're running into problems compiling the boost math library with GCC's
TR1. The problem comes from Boost.TR1, and I believe the #include_next
preprocessor directive. We are using the Ubuntu packages for g++ and
for Boost 1.40 which installs the headers in /usr/include/boost.
Here's a simple example which fails to compile:
----
#define BOOST_HAS_TR1_TUPLE 1
#include <boost/tr1/tuple.hpp>
int main()
{
return 0;
}
----
$ g++ -I/usr/include -c -o tr1_test.o tr1_test.cpp
In file included from tr1_test.cpp:2:
/usr/include/boost/tr1/tuple.hpp:13:43: error: no include path in which
to search for tr1/tuple
----
From the docs, defining BOOST_TR1_DISABLE_INCLUDE_NEXT should work, but
does not. I have tried inserting the following lines before the
#include, to no effect.
#define BOOST_TR1_DISABLE_INCLUDE_NEXT
#define BOOST_TR1_GCC_INCLUDE_PATH /usr/include/c++/4.4
The only workaround I could find is to explicitly include
boost/tr1/detail/config.hpp and undef BOOST_HAS_INCLUDE_NEXT.
Am I missing something in the documentation? What is the proper solution?
PS: I see a similar problem mentioned over a year ago:
<http://listarchives.boost.org/Archives/boost/2008/12/146552.php>. But would
the changes mentioned have been included in 1.40? I see no obvious
changes between trunk and 1.40 for the tuple and config headers, though
I haven't diffed them.
--
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233