使用WEBRTC编译NDK项目

Compiling ndk project with WebRTC

本文关键字:项目 NDK 编译 WEBRTC 使用      更新时间:2023-10-16

我正在尝试将WebRTC的C API集成到我的项目中。我能够构建libwebrtc并在Windows上链接它。

该项目是针对跨平台的,因此应与NDK一起编译。但是当我包括WebRTC标头时,它会如下所示:

webrtc/p2p/base/icetransportinternal.h(141,42) :  error: no member named 'to_string' in namespace 'std'
webrtc/p2p/base/icetransportinternal.h(141,42) :  error: no member named 'to_string' in namespace 'std'
webrtc/p2p/base/transportchannel.h(66,42) :  error: no member named 'to_string' in namespace 'std'
webrtc/p2p/base/transportchannel.h(66,42) :  error: no member named 'to_string' in namespace 'std'

我知道std::to_string在NDK环境中无法使用(请参阅Android NDK STD :: TO_STRING支持)。但是Wierd的事情是我已经成功地为Android构建了libwebrtc

我如何解决这种情况?

我知道std :: to_string在NDK环境中无法使用(请参阅Android NDK STD :: TO_STRING支持)。

取决于您选择的STL;它可与libc 一起使用,但不能使用gnustl(https://github.com/android-ndk/ndk/issues/82)。可以推定使用libc 构建的WebRTC,您正在使用Gnustl。

https://github.com/thepacific/webrtc-android-jni/tree/tree/master/so"下载所有这些文件并放入您的libs文件夹,然后直接使用system.load.load(" lib名称");