libc++ version: svn rev 141506<div>clang version: svn rev 141529</div><div>boost version: svn/release rev 74889</div><div>on Mac OS X 10.6</div><div><br></div><div>Hi,</div><div><br></div><div>I'm trying to compile boost (boost.serialization in particular) with clang/libc++. The compilation seems fine, however, come the linking, I get these errors:</div>
<div><br></div><div><div>clang-darwin.link.dll bin.v2/libs/serialization/build/clang-darwin-trunk/release/threading-multi/libboost_serialization.dylib</div><div><br></div><div>Undefined symbols for architecture x86_64:</div>
<div> "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:</div>
<div> boost::archive::detail::basic_iarchive_impl::load_pointer(boost::archive::detail::basic_iarchive&, void*&, boost::archive::detail::basic_pointer_iserializer const*, boost::archive::detail::basic_pointer_iserializer const* (*)(boost::serialization::extended_type_info const&)) in basic_iarchive.o</div>
<div> boost::archive::detail::basic_oarchive_impl::save_object(boost::archive::detail::basic_oarchive&, void const*, boost::archive::detail::basic_oserializer const&) in basic_oarchive.o</div><div> boost::archive::detail::basic_oarchive_impl::save_pointer(boost::archive::detail::basic_oarchive&, void const*, boost::archive::detail::basic_pointer_oserializer const*) in basic_oarchive.o</div>
<div> void boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load<short>(short&) in basic_text_iprimitive.o</div><div> void boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load<unsigned short>(unsigned short&) in basic_text_iprimitive.o</div>
<div> void boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load<int>(int&) in basic_text_iprimitive.o</div><div> boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load_binary(void*, unsigned long) in basic_text_iprimitive.o</div>
<div> ...</div><div> "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:</div><div> __ZNSt3__16vectorIN5boost7archive6detail19basic_iarchive_impl10cobject_idENS_9allocatorIS5_EEE9push_backEOS5_ in basic_iarchive.o</div>
<div> __ZNSt3__16vectorIN5boost7archive6detail19basic_iarchive_impl7aobjectENS_9allocatorIS5_EEE9push_backEOS5_ in basic_iarchive.o</div><div> boost::spirit::classic::chset<wchar_t>::chset(boost::spirit::classic::chset<wchar_t> const&) in xml_grammar.o</div>
<div> void boost::spirit::classic::utility::impl::detach<wchar_t>(boost::shared_ptr<boost::spirit::classic::basic_chset<wchar_t> >&) in xml_grammar.o</div><div> __ZNSt3__16vectorIN5boost6spirit7classic7utility4impl5rangeIwEENS_9allocatorIS7_EEE6insertENS_11__wrap_iterIPKS7_EEOS7_ in xml_grammar.o</div>
<div> boost::spirit::classic::utility::impl::range_run<wchar_t>::set(boost::spirit::classic::utility::impl::range<wchar_t> const&) in xml_grammar.o</div><div> std::__1::vector<boost::spirit::classic::utility::impl::range<wchar_t>, std::__1::allocator<boost::spirit::classic::utility::impl::range<wchar_t> > >::insert(std::__1::__wrap_iter<boost::spirit::classic::utility::impl::range<wchar_t> const*>, boost::spirit::classic::utility::impl::range<wchar_t> const&) in xml_grammar.o</div>
<div> ...</div><div> "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(short&)", referenced from:</div><div> void boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load<short>(short&) in basic_text_iprimitive.o</div>
<div> void boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load<boost::archive::class_id_type>(boost::archive::class_id_type&) in text_iarchive.o</div>
<div> "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned short&)", referenced from:</div><div> void boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load<unsigned short>(unsigned short&) in basic_text_iprimitive.o</div>
<div> void boost::archive::basic_text_iprimitive<std::__1::basic_istream<char, std::__1::char_traits<char> > >::load<boost::archive::library_version_type>(boost::archive::library_version_type&) in text_iarchive.o</div>
</div><div><br></div><div>...and a whole lot more</div><div><br></div><div>The build flags are "-std=c++0x -U__STRICT_ANSI__ -D__STDC_FORMAT_MACROS -stdlib=libc++" and I get the same errors even when I disable c++0x and no errors when I fallback to libstdc+++.</div>
<div><br></div><div>Here's a -v output from text_iarchive:</div><div><br></div><div>/opt/bin/clang" -cc1 -triple x86_64-apple-macosx10.6.8 -emit-obj -disable-free -main-file-name basic_iarchive.cpp -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -v -coverage-file bin.v2/libs/serialization/build/clang-darwin-trunk/release/threading-multi/basic_iarchive.o -resource-dir /opt/bin/../lib/clang/3.0 -U __STRICT_ANSI__ -D __STDC_FORMAT_MACROS -D BOOST_ALL_NO_LIB=1 -D BOOST_SERIALIZATION_DYN_LINK=1 -D NDEBUG -I . -stdlib=libc++ -fmodule-cache-path /var/folders/2J/2JQRY1NwFlKXHQSUa2kNCE+++TI/-Tmp-/clang-module-cache -O3 -Wno-inline -Wall -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-dispatch-method=mixed -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o bin.v2/libs/serialization/build/clang-darwin-trunk/release/threading-multi/basic_iarchive.o -x c++ libs/serialization/src/basic_iarchive.cpp</div>
<div><br></div><div><br></div><div><br></div><div>Regards,</div><div>Wil</div>