Reputation: 1565
I'm using boost installed via homebrew and added 'usr/local/include' to search header paths, and 'usr/local/lib' to search library paths. It's included fine but I get the following errors when compiling:
/usr/local/include/boost/move/unique_ptr.hpp:549:16: Unknown type name 'BOOST_RV_REF_BEG_IF_CXX11'
/usr/local/include/boost/move/unique_ptr.hpp:549:42: 'unique_ptr' cannot be the name of a parameter
/usr/local/include/boost/move/unique_ptr.hpp:549:59: Expected ')'
/usr/local/include/boost/move/unique_ptr.hpp:552:16: Use of undeclared identifier 'u'
These are the offending lines in the boost code:
template <class U, class E>
unique_ptr( BOOST_RV_REF_BEG_IF_CXX11 unique_ptr<U, E> BOOST_RV_REF_END_IF_CXX11 u
BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_moveconv_constr<T BOOST_MOVE_I D BOOST_MOVE_I U BOOST_MOVE_I E>::type* =0)
) BOOST_NOEXCEPT
: m_data(u.release(), ::boost::move_if_not_lvalue_reference<E>(u.get_deleter()))
{
//If T is not an array type, U derives from T
//it uses the default deleter and T has no virtual destructor, then you have a problem
BOOST_STATIC_ASSERT(( !::boost::move_upmu::missing_virtual_destructor
<D, typename unique_ptr<U, E>::pointer>::value ));
}
Upvotes: 1
Views: 1267
Reputation: 1565
The reason I got this error was because I was adding /usr/local/include into 'Header Search Paths' but not 'User Header Search Paths' in xcode. Don't know why it caused this error, something not being included perhaps, but adding it to both fixed it.
To get boost fully working, I also had to add the .dylib (from /usr/local/lib) to 'Link Binary With Libaries' in Build Phases.
Upvotes: 3