[TR1] can't compile with Boost installed in /usr/include (and with Boost.Test)

Fedora rawhide recently bumped the boost version from 1.34 to 1.37 so I gave it a try. I can't compile the code below: [ling@fedora-vm test]$ cat t.cpp #include <boost/test/unit_test.hpp> #include <memory> BOOST_AUTO_TEST_SUITE(dummy) BOOST_AUTO_TEST_CASE(foo) { std::tr1::shared_ptr<int> bar; } BOOST_AUTO_TEST_SUITE_END() [ling@fedora-vm test]$ g++ -I /usr/include/boost/tr1/tr1 -I /usr/include -c t.cpp In file included from /usr/include/boost/tr1/tr1/utility:19, from /usr/include/boost/config/no_tr1/utility.hpp:21, from /usr/include/boost/config/select_stdlib_config.hpp:20, from /usr/include/boost/config.hpp:40, from /usr/include/boost/test/detail/config.hpp:19, from /usr/include/boost/test/utils/class_properties.hpp:20, from /usr/include/boost/test/predicate_result.hpp:19, from /usr/include/boost/test/test_tools.hpp:19, from /usr/include/boost/test/unit_test.hpp:19, from t.cpp:1: /usr/include/boost/tr1/detail/config_all.hpp:117:26: error: no include path in which to search for utility In file included from /usr/include/boost/tr1/detail/config_all.hpp:130, from /usr/include/boost/tr1/tr1/utility:19, from /usr/include/boost/config/no_tr1/utility.hpp:21, from /usr/include/boost/config/select_stdlib_config.hpp:20, from /usr/include/boost/config.hpp:40, from /usr/include/boost/test/detail/config.hpp:19, from /usr/include/boost/test/utils/class_properties.hpp:20, from /usr/include/boost/test/predicate_result.hpp:19, from /usr/include/boost/test/test_tools.hpp:19, from /usr/include/boost/test/unit_test.hpp:19, from t.cpp:1: /usr/include/boost/tr1/detail/config.hpp:25:29: error: no include path in which to search for utility Defining BOOST_TR1_DISABLE_INCLUDE_NEXT helps to reduce the two errors to one, [ling@fedora-vm test]$ g++ -DBOOST_TR1_DISABLE_INCLUDE_NEXT -I /usr/include/boost/tr1/tr1 -I /usr/include -c t.cpp In file included from /usr/include/boost/tr1/detail/config_all.hpp:130, from /usr/include/boost/tr1/tr1/utility:19, from /usr/include/boost/config/no_tr1/utility.hpp:21, from /usr/include/boost/config/select_stdlib_config.hpp:20, from /usr/include/boost/config.hpp:40, from /usr/include/boost/test/detail/config.hpp:19, from /usr/include/boost/test/utils/class_properties.hpp:20, from /usr/include/boost/test/predicate_result.hpp:19, from /usr/include/boost/test/test_tools.hpp:19, from /usr/include/boost/test/unit_test.hpp:19, from t.cpp:1: /usr/include/boost/tr1/detail/config.hpp:25:29: error: no include path in which to search for utility I also have a local copy of Boost 1.37 at ~/include/boost, and I have no problems with that: [ling@fedora-vm test]$ g++ -I ~/include/boost/boost/tr1/tr1 -I ~/include/boost -c t.cpp Do you know what I am missing here? Thanks in advance for any tips.

Ling Li wrote:
Fedora rawhide recently bumped the boost version from 1.34 to 1.37 so I gave it a try. I can't compile the code below:
Unfortunately this is a bug in the TR1 library that hits you only if: * You have the TR1 headers in your include path. and: * Boost is installed in /usr/ I believe this is fixed in SVN Trunk: can you try replacing the contents of /usr/include/boost/tr1 with the latest code from SVN and see if that helps? HTH, John.

That solved the problem. Thanks! On Tue, Dec 30, 2008 at 5:12 AM, John Maddock <john@johnmaddock.co.uk>wrote:
Ling Li wrote:
Fedora rawhide recently bumped the boost version from 1.34 to 1.37
so I gave it a try. I can't compile the code below:
Unfortunately this is a bug in the TR1 library that hits you only if:
* You have the TR1 headers in your include path. and: * Boost is installed in /usr/
I believe this is fixed in SVN Trunk: can you try replacing the contents of /usr/include/boost/tr1 with the latest code from SVN and see if that helps?
HTH, John.
participants (2)
-
John Maddock
-
Ling Li