编译webrtc android端的ffmpeg问题

进入third_party/ffmpeg/chromium/scripts目录,执行:

./build_ffmpeg.py  android arm64

编译报错,检查config.log,具体报错内容如下:

clang --sysroot=/root/Projects/webrtc-checkout/src/third_party/android_ndk/platforms/android-21/arch-arm64 -I/root/Projects/webrtc-checkout/src/third_party/opus/src/include -I/root/Projects/webrtc-checkout/src/third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/root/Projects/webrtc-checkout/src/third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --target=aarch64-linux-android -march=armv8-a -c -o /tmp/ffconf.aHfjI7tL/test.o /tmp/ffconf.aHfjI7tL/test.c
clang --target=aarch64-linux-android -L/tmp/fakelinkerscripts -L/root/Projects/webrtc-checkout/src/third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android/ --gcc-toolchain=/root/Projects/webrtc-checkout/src/third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/ -fuse-ld=lld --sysroot=/root/Projects/webrtc-checkout/src/third_party/android_ndk/platforms/android-21/arch-arm64 -o /tmp/ffconf.aHfjI7tL/test /tmp/ffconf.aHfjI7tL/test.o
ld.lld: error: cannot open crtbegin_dynamic.o: No such file or directory
ld.lld: error: unable to find library -ldl
ld.lld: error: unable to find library -lc
ld.lld: error: unable to find library -ldl
ld.lld: error: cannot open crtend_android.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
C compiler test failed.

 

确定是sysroot路径实际上不存在所导致的,按照需要的路径建立一条软连接到本机器上已经存在的android环境中:

ln -s /opt/Android/android-ndk-r21b/platforms   /root/Projects/webrtc-checkout/src/third_party/android_ndk/platforms

问题于是得到解决

你可能感兴趣的:(webrtc)