[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #20 on issue 449 by kuznetsov.alexey: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Oh thanks @spacecad It is actually working. So I made XCodeProject from 2.5.0 referrencing to the source files. https://github.com/axet/protobuf-ios -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #19 on issue 449 by spacecad...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Use the CXX compiler variable to make libtool use the flags for linking too: ./configure CC=clang CXX="clang++ -std=c++11 -stdlib=libc++" CXXFLAGS="-O3" Tried with 2.5.0 protobuf-2.5.0 $ otool -L build/lib/libprotobuf.8.dylib build/lib/libprotobuf.8.dylib: /Users/spacecadet/src/protobuf-2.5.0/build/lib/libprotobuf.8.dylib (compatibility version 9.0.0, current version 9.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 28.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #18 on issue 449 by trojan...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 This appears to be resolved in 2.5.1-pre. When building protobuf under OSX 10.8.4 with: ./configure CC=clang CXX=clang++ CXXFLAGS='-stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' --prefix=/opt/local and a test project with: kraken:~/Source/Test/protobuf $ make /opt/local/bin/protoc --cpp_out=. addressbook.proto clang++ -stdlib=libc++ -O3 -g -I/opt/local/include -c -o readab.o readab.cpp clang++ -stdlib=libc++ -O3 -g -I/opt/local/include -c -o addressbook.pb.o addressbook.pb.cc clang++ -stdlib=libc++ -L/opt/local/lib -o readab readab.o addressbook.pb.o -lprotobuf clang++ -stdlib=libc++ -O3 -g -I/opt/local/include -c -o writeab.o writeab.cpp clang++ -stdlib=libc++ -L/opt/local/lib -o writeab writeab.o addressbook.pb.o -lprotobuf I get: kraken:~/Source/Test/protobuf $ otool -L readab readab: /opt/local/lib/libprotobuf.9.dylib (compatibility version 10.0.0, current version 10.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) kraken:~/Source/Test/protobuf $ otool -L /opt/local/lib/libprotobuf.9.dylib /opt/local/lib/libprotobuf.9.dylib: /opt/local/lib/libprotobuf.9.dylib (compatibility version 10.0.0, current version 10.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #17 on issue 449 by ltwar...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Hard to tell because i only need to do: ./configure --prefix=/usr CC=clang CXX=clang++ CXXFLAGS="-O2 -stdlib=libc++" LIBS="-lc++ -lc++abi" but You are closer than further to the solution :) -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #16 on issue 449 by yayj...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 I must say sorry for the mistake I made. I didn't notice that -stdlib=libc++ argument acts as a switch to decide whether libc++ to be used at linking time. It means, if using our previous configuration command line, -lc++ is useless while linking, because -lstdc++ will be passed to linker since -stdlib=libc++ is not specified. So, I think configuration command line should be ./configure CC=clang CXX=clang++ CXXFLAGS='-stdlib=libc++' LDFLAGS='-stdlib=libc++'. But, it still failed while linking. I checked the linker command line: /bin/sh ../libtool --tag=CXX --mode=link clang++ -D_THREAD_SAFE -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -stdlib=libc++ -version-info 8:0:0 -export-dynamic -no-undefined -stdlib=libc++ -o libprotobuf.la -rpath /usr/local/lib atomicops_internals_x86_gcc.lo atomicops_internals_x86_msvc.lo common.lo once.lo stringprintf.lo extension_set.lo generated_message_util.lo message_lite.lo repeated_field.lo wire_format_lite.lo coded_stream.lo zero_copy_stream.lo zero_copy_stream_impl_lite.lo strutil.lo substitute.lo structurally_valid.lo descriptor.lo descriptor.pb.lo descriptor_database.lo dynamic_message.lo extension_set_heavy.lo generated_message_reflection.lo message.lo reflection_ops.lo service.lo text_format.lo unknown_field_set.lo wire_format.lo gzip_stream.lo printer.lo tokenizer.lo zero_copy_stream_impl.lo importer.lo parser.lo -lz libtool: link: clang++ -dynamiclib -o .libs/libprotobuf.8.dylib .libs/atomicops_internals_x86_gcc.o .libs/atomicops_internals_x86_msvc.o .libs/common.o .libs/once.o .libs/stringprintf.o .libs/extension_set.o .libs/generated_message_util.o .libs/message_lite.o .libs/repeated_field.o .libs/wire_format_lite.o .libs/coded_stream.o .libs/zero_copy_stream.o .libs/zero_copy_stream_impl_lite.o .libs/strutil.o .libs/substitute.o .libs/structurally_valid.o .libs/descriptor.o .libs/descriptor.pb.o .libs/descriptor_database.o .libs/dynamic_message.o .libs/extension_set_heavy.o .libs/generated_message_reflection.o .libs/message.o .libs/reflection_ops.o .libs/service.o .libs/text_format.o .libs/unknown_field_set.o .libs/wire_format.o .libs/gzip_stream.o .libs/printer.o .libs/tokenizer.o .libs/zero_copy_stream_impl.o .libs/importer.o .libs/parser.o -lz-install_name /usr/local/lib/libprotobuf.8.dylib -compatibility_version 9 -current_version 9.0 -Wl,-single_module 2 files were linked, libprotobuf.la and libprotobuf.8.dylib. For libprotobuf.la, CXXFLAGS and LDFLAGS were both passed to clang++. But the 2 flags were missing while linking libprotobuf.8.dylib. Then I tried to add -stdlib=libc++ manually, everything was ok. $ otool -L .libs/libprotobuf.8.dylib .libs/libprotobuf.8.dylib: /usr/local/lib/libprotobuf.8.dylib (compatibility version 9.0.0, current version 9.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) I guess that might be caused by configure script or autoconf or something else to generate Makefile. So is that a problem? -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #15 on issue 449 by ltwar...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 I'm using 2.5.x too. This is not the linking command line, this is compiler invocation which is passing some things to the linker, You need to know what exactly is being called, for e.g ld.gold etc. Pass "--verbose" to the clang and see what things clang is exactly doing, this will also show You the linker invocation. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #14 on issue 449 by cvet...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 I have been bumping HARD into this one too. The default one within clang is libstdc++, so providing -lc++ results in that being linked to as well. Only -stdlib=libc++ option should be used if you don't want a library linked to both stdc++ and c++ libs. For me the problem seems to be that somehow LDFLAGS is somehow ignored when I do make (I provide LDFLAGS=-stdlib=libc++ on ./configure). This is the command called: /bin/sh ../libtool --tag=CXX --mode=link /usr/bin/clang++ -D_THREAD_SAFE -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -stdlib=libc++ -version-info 7:0:0 -export-dynamic -no-undefined -o libprotobuf.la -rpath /Users/cvetan/workspace/tundra/deps/osx-64/protobuf/lib common.lo once.lo extension_set.lo generated_message_util.lo message_lite.lo repeated_field.lo wire_format_lite.lo coded_stream.lo zero_copy_stream.lo zero_copy_stream_impl_lite.lo strutil.lo substitute.lo structurally_valid.lo descriptor.lo descriptor.pb.lo descriptor_database.lo dynamic_message.lo extension_set_heavy.lo generated_message_reflection.lo message.lo reflection_ops.lo service.lo text_format.lo unknown_field_set.lo wire_format.lo gzip_stream.lo printer.lo tokenizer.lo zero_copy_stream_impl.lo importer.lo parser.lo -lz -stdlib=libc++ and this is actually executed (notice that there is no mentioning of libc++ here) : libtool: link: /usr/bin/clang++ -dynamiclib -o .libs/libprotobuf.7.dylib .libs/common.o .libs/once.o .libs/extension_set.o .libs/generated_message_util.o .libs/message_lite.o .libs/repeated_field.o .libs/wire_format_lite.o .libs/coded_stream.o .libs/zero_copy_stream.o .libs/zero_copy_stream_impl_lite.o .libs/strutil.o .libs/substitute.o .libs/structurally_valid.o .libs/descriptor.o .libs/descriptor.pb.o .libs/descriptor_database.o .libs/dynamic_message.o .libs/extension_set_heavy.o .libs/generated_message_reflection.o .libs/message.o .libs/reflection_ops.o .libs/service.o .libs/text_format.o .libs/unknown_field_set.o .libs/wire_format.o .libs/gzip_stream.o .libs/printer.o .libs/tokenizer.o .libs/zero_copy_stream_impl.o .libs/importer.o .libs/parser.o -lz-install_name /Users/cvetan/workspace/tundra/deps/osx-64/protobuf/lib/libprotobuf.7.dylib -compatibility_version 8 -current_version 8.0 -Wl,-single_module which will result into the following: Undefined symbols for architecture x86_64: "std::__1::basic_string, std::__1::allocator >::find_first_of(char const*, unsigned long, unsigned long) const", referenced from: void google::protobuf::SplitStringToIteratorUsingstd::__1::char_traits, std::__1::allocator >, std::__1::allocatorstd::__1::char_traits, std::__1::allocator > > > > (std::__1::basic_string, std::__1::allocator > const&, char const*, std::__1::back_insert_iteratorstd::__1::char_traits, std::__1::allocator >, std::__1::allocatorstd::__1::char_traits, std::__1::allocator > > > >&) in strutil.o "std::__1::basic_string, std::__1::allocator >::find_first_not_of(char const*, unsigned long, unsigned long) const", referenced from: void google::protobuf::SplitStringToIteratorUsingstd::__1::char_traits, std::__1::allocator >, std::__1::allocatorstd::__1::char_traits, std::__1::allocator > > > > (std::__1::basic_string, std::__1::allocator > const&, char const*, std::__1::back_insert_iteratorstd::__1::char_traits, std::__1::allocator >, std::__1::allocatorstd::__1::char_traits, std::__1::allocator > > > >&) in strutil.o "std::__1::basic_string, std::__1::allocator >::find(char const*, unsigned long, unsigned long) const", referenced from: google::protobuf::StringReplace(std::__1::basic_stringstd::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_stringstd::__1::char_traits, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator >*) in strutil.o google::protobuf::compiler::ContainsParentReference(std::__1::basic_stringstd::__1::char_traits, std::__1::allocator > const&) in importer.o "std::__1::basic_string, std::__1::allocator >::find(char, unsigned long) const", referenced from: google::protobuf::DescriptorBuilder::LookupSymbolNoPlaceholder(std::__1::basic_stringstd::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, google::protobuf::DescriptorBuilder::ResolveMode) in descriptor.o "std::__1::basic_string, std::__1::allocator >::rfind(char, unsigned long) const", referenced from: google::protobuf::DescriptorBuilder::AddPackage(std::__1::basic_stringstd::__1::char_traits, std::__1::allocator > const&, google::protobuf::Message const&, google::protobuf::FileDescriptor const*) in descriptor.o google::proto
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #13 on issue 449 by yayj...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Here's the linking command line: clang++ -dynamiclib -o .libs/libprotobuf.8.dylib .libs/atomicops_internals_x86_gcc.o .libs/atomicops_internals_x86_msvc.o .libs/common.o .libs/once.o .libs/stringprintf.o .libs/extension_set.o .libs/generated_message_util.o .libs/message_lite.o .libs/repeated_field.o .libs/wire_format_lite.o .libs/coded_stream.o .libs/zero_copy_stream.o .libs/zero_copy_stream_impl_lite.o .libs/strutil.o .libs/substitute.o .libs/structurally_valid.o .libs/descriptor.o .libs/descriptor.pb.o .libs/descriptor_database.o .libs/dynamic_message.o .libs/extension_set_heavy.o .libs/generated_message_reflection.o .libs/message.o .libs/reflection_ops.o .libs/service.o .libs/text_format.o .libs/unknown_field_set.o .libs/wire_format.o .libs/gzip_stream.o .libs/printer.o .libs/tokenizer.o .libs/zero_copy_stream_impl.o .libs/importer.o .libs/parser.o -lz -lc++-install_name /usr/local/lib/libprotobuf.8.dylib -compatibility_version 9 -current_version 9.0 -Wl,-single_module I didn't find why linking libstdc++. And, by the way, now I'm using 2.5.0. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Updates: Status: Fixed Comment #12 on issue 449 by xiaof...@google.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Fixed in r475 -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #11 on issue 449 by rhl...@comcast.net: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Is google planning a fix and re-release? thank you -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #10 on issue 449 by ltwar...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 When this will hit the trunk ? :) -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #7 on issue 449 by ltwar...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Link in verbose mode and check what things is Your linker pulling in, maybe it is some default. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #6 on issue 449 by yayj...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 On OSX, libc++ takes libc++abi as the ABI layer by default I think. And otool command doesn't print the indirect dependency libraries. Let's see: protobuf-2.4.1$ otool -L src/.libs/libprotobuf.dylib src/.libs/libprotobuf.dylib: /usr/lib/libprotobuf.7.dylib (compatibility version 8.0.0, current version 8.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) protobuf-2.4.1$ otool -L /usr/lib/libc++.1.dylib /usr/lib/libc++.1.dylib: /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current version 24.2.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) I also tried to use your configure parameters, but it still contains libstdc++: protobuf-2.4.1$ otool -L src/.libs/libprotobuf.dylib src/.libs/libprotobuf.dylib: /usr/lib/libprotobuf.7.dylib (compatibility version 8.0.0, current version 8.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current version 24.4.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #5 on issue 449 by ltwar...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Im doing this in Linux. My configure: ./configure --prefix=/usr CC=clang CXX=clang++ CXXFLAGS="-O2 -stdlib=libc++" LIBS="-lc++ -lc++abi" After compilation and installation: ldd /usr/lib/libprotobuf.so linux-vdso.so.1 (0x7fffe4505000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x7fe3199ea000) libz.so.1 => /usr/lib/libz.so.1 (0x7fe3197d4000) libc++abi.so.1 => /usr/lib/libc++abi.so.1 (0x7fe319785000) libc++.so.1 => /usr/lib/libc++.so.1 (0x7fe3195f6000) libm.so.6 => /usr/lib/libm.so.6 (0x7fe3192f8000) libc.so.6 => /usr/lib/libc.so.6 (0x7fe318f4b000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fe318d35000) /usr/lib/ld-linux-x86-64.so.2 (0x7fe319d63000) librt.so.1 => /usr/lib/librt.so.1 (0x7fe318b2d000) There is not libstdc++ Note: libc++ does not come with the ABI layer, that is why i'm linking also libc++abi. This may be the cause that in Your case libstdc++ is still pulled as a fallback to unresolved symbols, i think that this is the way that FreeBSD guys did it or maybe You linker has some defaults. Ps. The "string" case is the way to version libraries, in this case C++11 inline namespace feature is used. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #4 on issue 449 by yayj...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Yep, it seems that my assumption was correct. As a result, I tried to rebuild protobuf library with libc++ but failed. According to the description in your stackoverflow link, libc++ uses std::__1 namespace while libstdc++ uses std directly. So, that means -stdlib=libc++ flags makes compilation with libc++, but without libc++ when linking. It's very strange. Then I try to add it manually: protobuf-2.4.1$ ./configure CC=clang CXX=clang++ CXXFLAGS='-stdlib=libc++' LIBS='-lc++' protobuf-2.4.1$ make Everything seems OK and libprotobuf.dylib is generated. Now checking its dependency: protobuf-2.4.1$ otool -L src/.libs/libprotobuf.dylib src/.libs/libprotobuf.7.dylib: /usr/lib/libprotobuf.7.dylib (compatibility version 8.0.0, current version 8.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) Why it still contains libstdc++? -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Updates: Status: Accepted Owner: xiaof...@google.com Comment #3 on issue 449 by xiaof...@google.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Thanks for the patch. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #2 on issue 449 by ltwar...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Ps. this solves the problem of building protobuf with libc++ and clang++ :) Your problem with the link errors comes from that You are trying to mix libs compiled with libstdc++ and libc++, this can't be as for example string implementations in those two differ so those libs are not binary compatible (except for some low lebel stuff), see this post: http://stackoverflow.com/questions/8454329/why-cant-clang-with-libc-in-c0x-mode-link-this-boostprogram-options-examp -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Re: Issue 449 in protobuf: Link error while using clang++ with -stdlib=libc++ flag in OSX
Comment #1 on issue 449 by ltwar...@gmail.com: Link error while using clang++ with -stdlib=libc++ flag in OSX http://code.google.com/p/protobuf/issues/detail?id=449 Index: src/google/protobuf/message.cc === --- src/google/protobuf/message.cc (revision 463) +++ src/google/protobuf/message.cc (working copy) @@ -32,6 +32,7 @@ // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. +#include #include #include And the problem is gone, i saw this first time here: http://www.freebsd.org/cgi/query-pr.cgi?pr=166011 I'm willing to see this go upstream. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.