Issue with library built from M74

1,313 views
Skip to first unread message

Joel Sutherland

unread,
Apr 1, 2019, 6:09:51 PM4/1/19
to discuss-webrtc
Everything works up to M73, but when linking my project with the library build from M74 I get the following error:

*Undefined symbols for architecture x86_64:
  "vtable for std::__1::bad_function_call", referenced from:
      std::__1::bad_function_call::bad_function_call() in <<myLib>>.a(throw_delegate.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*

There were obviously some API changes and file renames, which I think I successfully accommodated, but that could be related.

Thanks!

mbon...@webrtc.org

unread,
Apr 2, 2019, 2:02:30 AM4/2/19
to discuss-webrtc
Hi Joel, can you tell more about your build configuration?

This seems to be related to exceptions and I think the linker error refers to this line or to the C++ version you are using. Having the GN args you used would be useful to help (or also the compiler invocation used to build throw_delegate.o).

Joel Sutherland

unread,
Apr 2, 2019, 10:32:03 AM4/2/19
to discuss-webrtc
Thanks for the help!

gn gen out/Debug --args='target_os="mac" target_cpu="x64" use_rtti=true is_debug=true' --ide=xcode


Here's the linker command:

Ld DerivedData/Tuple/Build/Products/Debug/TupleDev.app/Contents/MacOS/TupleDev normal x86_64

   cd /Users/joel/Code/Tuple/macapp

   export MACOSX_DEPLOYMENT_TARGET=10.13

   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/Users/joel/Code/Tuple/macapp/DerivedData/Tuple/Build/Products/Debug -F/Users/joel/Code/Tuple/macapp/DerivedData/Tuple/Build/Products/Debug -F/Users/joel/Code/Tuple/macapp/Carthage/Build/Mac -F/Users/joel/Code/Tuple/macapp/Vendor -F/Users/joel/Code/Tuple/macapp -F/Users/joel/Code/Tuple/macapp/Vendor/Sparkle-1.21.2 -filelist /Users/joel/Code/Tuple/macapp/DerivedData/Tuple/Build/Intermediates.noindex/Tuple.build/Debug/TupleApp.build/Objects-normal/x86_64/TupleDev.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -mmacosx-version-min=10.13 -Xlinker -object_path_lto -Xlinker /Users/joel/Code/Tuple/macapp/DerivedData/Tuple/Build/Intermediates.noindex/Tuple.build/Debug/TupleApp.build/Objects-normal/x86_64/TupleDev_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -fprofile-instr-generate -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -Xlinker -add_ast_path -Xlinker /Users/joel/Code/Tuple/macapp/DerivedData/Tuple/Build/Intermediates.noindex/Tuple.build/Debug/TupleApp.build/Objects-normal/x86_64/TupleDev.swiftmodule -ObjC -framework ServiceManagement -framework Security -framework MetalKit -framework Sparkle -lc++ -lTupleKit -framework Crashlytics -framework Fabric -Xlinker -dependency_info -Xlinker /Users/joel/Code/Tuple/macapp/DerivedData/Tuple/Build/Intermediates.noindex/Tuple.build/Debug/TupleApp.build/Objects-normal/x86_64/TupleDev_dependency_info.dat -o /Users/joel/Code/Tuple/macapp/DerivedData/Tuple/Build/Products/Debug/TupleDev.app/Contents/MacOS/TupleDev


Let me know if you were looking for something else.

Alex Roman

unread,
Apr 7, 2019, 2:37:14 AM4/7/19
to discuss-webrtc
I am also seeing the same when trying to link to the libwebrtc.a produced by the build system for my Mac:

/usr/bin/clang++  -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/tnt.dir/src/main.cc.o CMakeFiles/tnt.dir/src/tnt.cc.o CMakeFiles/tnt.dir/src/webrtc_stack.cc.o  -o tnt  -L/usr/local/lib  -L/usr/local/Cellar/libevent/2.1.8/lib  -L/usr/local/Cellar/libuv/1.27.0/lib  -L/usr/local/Cellar/openssl/1.0.2r/lib  -L/usr/local/Cellar/libosip/5.0.0/lib  -L/Users/alex.roman/Work/src/webrtc/tnt/webrtc/src/out/Debug/obj -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/local/Cellar/libevent/2.1.8/lib -Wl,-rpath,/usr/local/Cellar/libuv/1.27.0/lib -Wl,-rpath,/usr/local/Cellar/openssl/1.0.2r/lib -Wl,-rpath,/usr/local/Cellar/libosip/5.0.0/lib -Wl,-rpath,/Users/alex.roman/Work/src/webrtc/tnt/webrtc/src/out/Debug/obj -lwebsockets -luv -lpthread -ldl -levent -lcrypto -losipparser2 -losip2 -lwebrtc -framework Foundation -framework CoreAudio -framework AudioToolbox -framework CoreGraphics
Undefined symbols for architecture x86_64:
  "vtable for std::__1::bad_function_call", referenced from:
      std::__1::bad_function_call::bad_function_call() in libwebrtc.a(throw_delegate.o)

  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64


I'm not sure how to resolve this linking issue.

mbon...@webrtc.org

unread,
Apr 8, 2019, 8:08:12 AM4/8/19
to discuss-webrtc
Can you try to use the following GN arg as well?

libcxx_abi_unstable = false

Albert Gu

unread,
Aug 2, 2019, 2:37:00 AM8/2/19
to discuss-webrtc

fosh...@gmail.com

unread,
Oct 15, 2020, 10:37:52 PM10/15/20
to discuss-webrtc
I met a very similar problem liking libwebrtc.a to my project on Mac using M84. Did you find a solution?

Undefined symbols for architecture x86_64:

  "std::__1::__libcpp_debug_function", referenced from:

      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(char const*) in libwebrtc.a(audio_processing.o)

      std::__1::char_traits<char>::copy(char*, char const*, unsigned long) in libwebrtc.a(audio_processing.o)

      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*) in libwebrtc.a(webrtc_sdp.o)

      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char const*, unsigned long) const in libwebrtc.a(webrtc_sdp.o)

      std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::operator[](unsigned long) in libwebrtc.a(webrtc_sdp.o)

      bool std::__1::operator==<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in libwebrtc.a(webrtc_sdp.o)

      void std::__1::advance<cricket::RidDescription*>(cricket::RidDescription*&, std::__1::iterator_traits<cricket::RidDescription*>::difference_type) in libwebrtc.a(webrtc_sdp.o)

      ...

  "vtable for std::__1::bad_function_call", referenced from:

      std::__1::bad_function_call::bad_function_call() in libwebrtc.a(throw_delegate.o)

  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


Thanks.

Yaowen Guo

unread,
May 11, 2021, 4:04:45 AM5/11/21
to discuss-webrtc
The `use_custom_libcxx=false` args work for me:
gn gen out/arm64 --args='target_os="android" target_cpu="arm64" use_custom_libcxx=false'
ninja -C out/arm64/ webrtc


Yaowen Guo

unread,
May 11, 2021, 4:04:46 AM5/11/21
to discuss-webrtc
I use `use_custom_libcxx=false` args make std::__1 became std::__1.

gn gen out/arm64 --args='target_os="android" target_cpu="arm64" use_custom_libcxx=false'
On Tuesday, April 2, 2019 at 6:09:51 AM UTC+8 jdsuth...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages