Boost graph issues with Xcode 4.4
Hello,
I'm trying to use boost 1.51 graph library with Xcode 4.4 and running into problems. While boost will build fine, when I try some simple graph code as per the documentation:
#include <iostream> // for std::cout
#include <utility> // for std::pair
#include <algorithm> // for std::for_each
#include
On Mon, 27 Aug 2012, Jon McCormack wrote:
Hello,I'm trying to use boost 1.51 graph library with Xcode 4.4 and running into problems. While boost will build fine, when I try some simple graph code as per the documentation:
(snip)
I get the following errors: In file included from graph.cpp:4: In file included from /usr/local/include/boost/graph/graph_traits.hpp:26: In file included from /usr/local/include/boost/pending/property.hpp:13: In file included from /usr/local/include/boost/type_traits.hpp:35: In file included from /usr/local/include/boost/type_traits/has_operator.hpp:12: In file included from /usr/local/include/boost/type_traits/has_bit_and.hpp:43: /usr/local/include/boost/type_traits/detail/has_binary_operator.hpp:220:1: error: C++ requires a type specifier for all declarations BOOST_TT_AUX_BOOL_TRAIT_DEF3(BOOST_TT_TRAIT_NAME, Lhs, Rhs=Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Lhs, ... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/boost/type_traits/detail/has_binary_operator.hpp:220:30: error: use of undeclared identifier 'has_bit_and' BOOST_TT_AUX_BOOL_TRAIT_DEF3(BOOST_TT_TRAIT_NAME, Lhs, Rhs=Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Lhs, ... ^ /usr/local/include/boost/type_traits/has_bit_and.hpp:12:29: note: expanded from macro 'BOOST_TT_TRAIT_NAME' #define BOOST_TT_TRAIT_NAME has_bit_and ^ In file included from graph.cpp:4: In file included from /usr/local/include/boost/graph/graph_traits.hpp:26: In file included from /usr/local/include/boost/pending/property.hpp:13: In file included from /usr/local/include/boost/type_traits.hpp:35: In file included from /usr/local/include/boost/type_traits/has_operator.hpp:12: In file included from /usr/local/include/boost/type_traits/has_bit_and.hpp:43: /usr/local/include/boost/type_traits/detail/has_binary_operator.hpp:220:230: error: expected ';' after top level declarator ...Lhs, Rhs=Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Lhs, Rhs, Ret >::value))
The errors continue for a number of type_traits/detail files. Is this an issue with clang?
I don't see any test failures with type_traits on Clang on URL:http://www.boost.org/development/tests/release/developer/type_traits.htm..., but that may not include the version that you have. In any case, this looks like a Boost.TypeTraits issue, so you might want to try running its test suite (run "./b2 libs/type_traits/test" from the top Boost source directory, adding any toolset flags you normally use). If that fails, you might want to post that as a separate message to boost-users with "[type_traits]" in the subject. -- Jeremiah Willcock
On Aug 27, 2012, at 7:16 AM, Jon McCormack
Hello, I'm trying to use boost 1.51 graph library with Xcode 4.4 and running into problems. While boost will build fine, when I try some simple graph code as per the documentation: #include <iostream> // for std::cout #include <utility> // for std::pair #include <algorithm> // for std::for_each #include
#include #include using namespace boost;
int main(int,char*[]) { // create a typedef for the Graph type typedef adjacency_list
Graph; return 0; }
I stuffed this code into a source file and compiled it with: $ clang --version Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn) Target: x86_64-apple-darwin12.1.0 Thread model: posix $ clang++ -I /Volumes/EyeFive/Sources/boost/release junk.cpp $ No errors on Mtn Lion with Xcode 4.4.1 installed. I think we need some more information here. -- Marshall Marshall Clow Idio Software mailto:mclow.lists@gmail.com A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
Thanks for your help, I've located the source of the problem. I upgraded to boost 1.51 and built, then ran ./b2 install. I had an earlier version of boost already installed and running ./b2 install seems to mix the two versions. Manually doing an "rm -rf /usr/local/boost" before running ./b2 install fixed the problem. Regards, Jon On 27/08/2012, at 5:40 PM, Marshall Clow wrote:
On Aug 27, 2012, at 7:16 AM, Jon McCormack
wrote: Hello, I'm trying to use boost 1.51 graph library with Xcode 4.4 and running into problems. While boost will build fine, when I try some simple graph code as per the documentation: #include <iostream> // for std::cout #include <utility> // for std::pair #include <algorithm> // for std::for_each #include
#include #include using namespace boost;
int main(int,char*[]) { // create a typedef for the Graph type typedef adjacency_list
Graph; return 0; } I stuffed this code into a source file and compiled it with: $ clang --version Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn) Target: x86_64-apple-darwin12.1.0 Thread model: posix $ clang++ -I /Volumes/EyeFive/Sources/boost/release junk.cpp $
No errors on Mtn Lion with Xcode 4.4.1 installed. I think we need some more information here.
-- Marshall
Marshall Clow Idio Software mailto:mclow.lists@gmail.com
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Jeremiah Willcock
-
Jon McCormack
-
Marshall Clow