I have done all instructions to build AppRTCDemo on Ubuntu 15.10 in this link http://webrtc.org/native-code/android/ and when I'm trying this command "ninja -C out/Debug AppRTCDemo" i get this result

ninja: Entering directory `out/Debug' [2326/2553] ACTION Compiling libjingle_peerconnection_java java sources java/android/org/webrtc/VideoCapturerAndroid.java:49: warning: [deprecation] Camera in android.hardware has been deprecated android.hardware.Camera.PreviewCallback, ^

java/android/org/webrtc/VideoCapturerAndroid.java:49: warning: [deprecation] PreviewCallback in Camera has been deprecated android.hardware.Camera.PreviewCallback, ^

2 warnings [2530/2553] LINK md5sum_bin_host

FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -pthread -fPIC -B/media/shady/Shady/webrtc_checkout/src/third_party/binutils/Linux_x64/Release/bin -o md5sum_bin_host -Wl,--start-group obj.host/chromium/src/tools/android/md5sum/md5sum_bin_host.md5sum.o obj.host/chromium/src/base/libbase.a obj.host/chromium/src/base/libbase_static.a obj.host/chromium/src/third_party/modp_b64/libmodp_b64.a obj.host/chromium/src/base/third_party/dynamic_annotations/libdynamic_annotations.a obj.host/chromium/src/base/third_party/libevent/libevent.a -Wl,--end-group -lrt

/usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/atomic_base.h:362: error: undefined reference to '__atomic_is_lock_free'

/usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/atomic_base.h:362: error: undefined reference to '__atomic_is_lock_free'

/usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/atomic_base.h:354: error: undefined reference to '__atomic_is_lock_free'

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

ninja: build stopped: subcommand failed.

Please anyone can help me because I'm stuck at this error for along time and I made a lot of searches on the internet and I found nothing useful. Thanks in advance.

1 Answer 1


I got this error in branch 51. I found the problem is md5sum must link to libatomic when use gcc 5.x version. So, i modify the file <dir of webrtc>/src/chromium/src/tools/android/md5sum/md5sum.gyp as follows:

diff --git a/tools/android/md5sum/md5sum.gyp b/tools/android/md5sum/md5sum.gyp
index 9099ba9..177883d 100644  
--- a/tools/android/md5sum/md5sum.gyp  
+++ b/tools/android/md5sum/md5sum.gyp  
@@ -76,6 +76,18 @@  
       'sources': [  
+      'conditions': [  
+        [  
+            "OS=='android'",  
+            {  
+            "link_settings": {    
+                "libraries": [  
+                    "-latomic"
+                    ]  
+                }  
+            }  
+        ],  
+      ],  

then cd to <dir of webrtc>/src and run:

python webrtc/build/gyp_webrtc.py
ninja -C out/Debug AppRTCDemo

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .