0

I am trying to integrate WebRTC's c++ api to my project. And I was able to build libwebrtc and link it on Windows.

This project is cross-platform targeted so it should be compiled with NDK. But when I included WebRTC headers, it complains as below:

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'

I know std::to_string is unusable in NDK environment (see Android ndk std::to_string support). But wierd thing is that I have successfully built libwebrtc for Android.

How do I resolve this situation?

Community
  • 1
  • 1
Jaemin Park
  • 250
  • 2
  • 8
  • Did you build the [webrtc](https://chromium.googlesource.com/external/webrtc/+/master/webrtc/BUILD.gn#225) target for Android on a Windows machine? I haven't tried but AFAIK cross-compiling for Android is only supported on the Linux platform. Can you provide the command line you used to run GN and to compile? – kjellander Feb 16 '17 at 08:35
  • @hkjellander Yes, I build the library on Ubuntu 16.04(docker environment) and copied it to Windows machine. It is compile-time error, not linking things. – Jaemin Park Feb 16 '17 at 08:43
  • @hkjellander For your information the `gn` command I used is below: `gn gen out/ReleaseAndroid --args='is_debug=false rtc_include_tests=false rtc_enable_protobuf=false rtc_build_ssl=false rtc_ssl_root="/usr/local/ssl/android-19/include" target_os="android" target_cpu="arm"'` – Jaemin Park Feb 16 '17 at 08:44
  • 1
    I'm fixing this here: https://codereview.webrtc.org/2697313003/ – Taylor Brandstetter Feb 16 '17 at 17:58
  • @TaylorBrandstetter Thanks! – Jaemin Park Feb 17 '17 at 07:25

2 Answers2

0

https://github.com/ThePacific/webrtc-android-jni/tree/master/so "download all these files and put in your libs folder then directly use system.load("lib name ");

PRATEEK BHARDWAJ
  • 2,364
  • 2
  • 21
  • 35
  • Thanks for your reply, but there is only AEC module support in your link. I would like to grab most feature of WebRTC as possible. – Jaemin Park Feb 16 '17 at 08:14
0

I know std::to_string is unusable in NDK environment (see Android ndk std::to_string support).

Depends on which STL you selected; it is available with libc++, but not gnustl (https://github.com/android-ndk/ndk/issues/82). Presumable webrtc was built with libc++ and you're using gnustl.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79