Boost logo

Boost Users :

Subject: [Boost-users] Boost graph issues with Xcode 4.4
From: Jon McCormack (jon.mccormack_at_[hidden])
Date: 2012-08-27 10:16:17


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 <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>

  using namespace boost;
  
int main(int,char*[]) {
    // create a typedef for the Graph type
    typedef adjacency_list<vecS, vecS, bidirectionalS> Graph;
...etc.

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?
Thanks,

Jon

                                                                                                                      



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net