I’m using homebrew to install bitcoind on OS X. On 10.8 it worked fine, but on 10.9 beta it doesn’t - I get a compiler error.
I think it’s because on 10.9 Apple exclusively switched away from GNU gcc in favor of clang, and also opted out of stdlibc++ in favor of it’s own libc++ implementation. The error and homebrew log are as follows:
In file included from alert.cpp:11: In file included from /private/tmp/bitcoind-FMyT/src/alert.h:13: In file included from /private/tmp/bitcoind-FMyT/src/util.h:31: In file included from /private/tmp/bitcoind-FMyT/src/netbase.h:10: /private/tmp/bitcoind-FMyT/src/serialize.h:911:10: error: class member cannot be redeclared void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const... ^ /private/tmp/bitcoind-FMyT/src/serialize.h:898:10: note: previous declaration is here void insert(iterator it, const_iterator first, const_iterator last) ^ /private/tmp/bitcoind-FMyT/src/serialize.h:911:10: error: redefinition of 'insert' void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const... ^ /private/tmp/bitcoind-FMyT/src/serialize.h:898:10: note: previous definition is here void insert(iterator it, const_iterator first, const_iterator last) ^ 2 errors generated. make: *** [obj/alert.o] Error 1 ==> Formula Tap: wysenynja/bitcoin Path: /usr/local/Library/Taps/wysenynja-bitcoin/bitcoind.rb ==> Configuration HOMEBREW_VERSION: 0.9.4 HEAD: f9223a5bac46749558bd4c9a6df8c06d929b846b CPU: quad-core 64-bit ivybridge OS X: 10.9-x86_64 Xcode: 5.0 => /Library/Developer/CommandLineTools X11: N/A ==> ENV HOMEBREW_CC: clang MAKEFLAGS: -j1 CMAKE_PREFIX_PATH: /usr/local/opt/berkeley-db4:/usr/local CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/Python.framework/Versions/2.7/Headers CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9 HOMEBREW_MAKE_JOBS: 1 ACLOCAL_PATH: /usr/local/share/aclocal OBJC: cc PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/berkeley-db4/bin:/usr/bin:/bin:/usr/sbin:/sbin
And here is another error that I get when I “fix” previous one by just deleting one of the offending constructors:
In file included from rpcdump.cpp:5: In file included from /Library/Developer/CommandLineTools/usr/bin/../lib/c++/v1/iostream:38: In file included from /Library/Developer/CommandLineTools/usr/bin/../lib/c++/v1/ios:216: /Library/Developer/CommandLineTools/usr/bin/../lib/c++/v1/__locale:144:29: error: cannot initialize a parameter of type 'std::__1::locale::facet *' with an lvalue of type 'const boost::date_time::time_input_facet<boost::posix_time::ptime, char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > > *' __install_ctor(__other, __f, __f ? __f->id.__get() : 0); ^~~ rpcdump.cpp:32:23: note: in instantiation of function template specialization 'std::__1::locale::locale<const boost::date_time::time_input_facet<boost::posix_time::ptime, char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > > >' requested here const std::locale loc(std::locale::classic(), &facet); ^ /Library/Developer/CommandLineTools/usr/bin/../lib/c++/v1/__locale:96:46: note: passing argument to parameter here void __install_ctor(const locale&, facet*, long);
Does anyone have an idea how this can be fixed? I can provide more information if necessary.