我正在尝试将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 support)。但奇怪的是,我已成功为Android构建了libwebrtc
。
如何解决这种情况?
答案 0 :(得分:0)
https://github.com/ThePacific/webrtc-android-jni/tree/master/so"下载所有这些文件并放入你的libs文件夹然后直接使用system.load(" lib name");
答案 1 :(得分:0)
我知道std :: to_string在NDK环境中无法使用(请参阅Android ndk std :: to_string支持)。
取决于您选择的STL;它可以在libc ++中使用,但不能用于gnustl(https://github.com/android-ndk/ndk/issues/82)。 Presumable webrtc是用libc ++构建的,你正在使用gnustl。