Hi,

does anybody know how I can compile C++11 code on Mountain Lion and
lower without using libc++?

The problem I face is that rethinkdb uses std::move (and probably other
features) from C++11. To do this, it checks for the clang compiler and
passes -stdlib=libc++ in CXXFLAGS if it detects clang on OS X.

Rethinkdb also uses protobuf-cpp, which requires linking against
libprotobuf.dylib. However, libprotobuf is built against libstdc++. This
leads to the following problem when rethinkdb tries to use protobuf:

> Error: Unable to compile sample protobuf file. Try running ./configure with 
> the --fetch protoc option
> Undefined symbols for architecture x86_64:
>   "google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char 
> const*, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, 
> std::__1::allocator<char> > const&))", referenced from:
>       protobuf_AddDesc_mk_2fgen_2fprotoc_2ftest_2eproto() in test-umpU92.o
>   
> "google::protobuf::DescriptorPool::FindFileByName(std::__1::basic_string<char,
>  std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", 
> referenced from:
>       protobuf_AssignDesc_mk_2fgen_2fprotoc_2ftest_2eproto() in test-umpU92.o

So the problem is that the linker is looking for the symbol in
libprotobuf that was compiled against libc++ (see the usage of
std::__1::basic_string, which is specific to libc++), but cannot find
the symbol, because libprotobuf has been compiled against libstdc++.

Any ideas how to fix this? Should I just pass --fetch protoc --static
protoc to have rethinkdb compile a local version of protobuf?

-- 
Clemens Lang

_______________________________________________
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to