记录Android 加载 webrtc libwebrtc.a

2023-09-24  本文已影响0人  FM_1ad7

下载webrtc参考网址: https://blog.csdn.net/yinshipin007/article/details/124696212

1、切换到 webrtc_android/src 目录

gn gen ../x86  --args='treat_warnings_as_errors=false target_os="android" target_cpu="x86" use_custom_libcxx=false  android_full_debug=true symbol_level=2 use_rtti=true rtc_include_tests=false '
ninja -C ../x86

2、出现问题
···
Build with "use_custom_libcxx=false" args for gn will get error: ld.lld: error: undefined symbol: _Unwind_Backtrace
修改代码:

  1. Change the src/buildtools/third_party/libunwind/BUILD.gn
source_set("libunwind") {
  ...
}

add visibility

source_set("libunwind") {
  visibility = ["//build/config:common_deps"]
  ...
}
  1. Change the src/build/config/BUILD.gn
if (use_custom_libcxx) {
  public_deps += [ "//buildtools/third_party/libc++" ]
}

to

if (use_custom_libcxx) {
  public_deps += [ "//buildtools/third_party/libc++" ]
} else {
  public_deps += [ "//buildtools/third_party/libunwind" ]
}

问题参考网址: https://bugs.chromium.org/p/webrtc/issues/detail?id=13535
···

上一篇下一篇

猜你喜欢

热点阅读