我试图在官方网站上使用 the instruction编译WebRTC。当我输入命令ninja -C out/Debug时,我得到了一个巨大的错误清单。我猜想,提供整个列表是没有意义的,但是此字符串有几次出现:

../../third_party/llvm-build/Release+Asserts/bin/clang++: 1:../../third_party/llvm-build/Release+Asserts/bin/clang++:Syntax error: "(" unexpected

我机器上的Clang版本:

$ clang --versionUbuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)Target: i386-pc-linux-gnuThread model: posix

我不知道该怎么做。有人可以帮我吗?

UPD。整个错误清单:

$ ninja -C out/Debugninja: Entering directory `out/Debug'[3/2955] CXX obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_bitrate_estimator_abs_send_time.oFAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_bitrate_estimator_abs_send_time.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DEXPAT_RELATIVE_PATH -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=259396-1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0 -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -Igen -I../.. -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -momit-leaf-frame-pointer -mstack-alignment=16 -mstackrealign -fcolor-diagnostics -B/home/maximus/workspaces/work/webrtc/webrtc-checkout/src/third_party/binutils/Linux_x64/Release/bin -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -msse2 -mfpmath=sse -mmmx -m32 --sysroot=/home/maximus/workspaces/work/webrtc/webrtc-checkout/src/build/linux/debian_wheezy_i386-sysroot -O0 -g -funwind-tables -Wnon-virtual-dtor -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -c ../../webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc -o obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_bitrate_estimator_abs_send_time.o../../third_party/llvm-build/Release+Asserts/bin/clang++: 1: ../../third_party/llvm-build/Release+Asserts/bin/clang++: Syntax error: "(" unexpected[3/2955] CXX obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_bitrate_estimator_single_stream.oFAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_bitrate_estimator_single_stream.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DEXPAT_RELATIVE_PATH -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=259396-1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0 -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -Igen -I../.. -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -momit-leaf-frame-pointer -mstack-alignment=16 -mstackrealign -fcolor-diagnostics -B/home/maximus/workspaces/work/webrtc/webrtc-checkout/src/third_party/binutils/Linux_x64/Release/bin -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -msse2 -mfpmath=sse -mmmx -m32 --sysroot=/home/maximus/workspaces/work/webrtc/webrtc-checkout/src/build/linux/debian_wheezy_i386-sysroot -O0 -g -funwind-tables -Wnon-virtual-dtor -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -c ../../webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc -o obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_bitrate_estimator_single_stream.o../../third_party/llvm-build/Release+Asserts/bin/clang++: 1: ../../third_party/llvm-build/Release+Asserts/bin/clang++: Syntax error: "(" unexpected[3/2955] CXX obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_estimator_proxy.oFAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_estimator_proxy.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DEXPAT_RELATIVE_PATH -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=259396-1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0 -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -Igen -I../.. -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -momit-leaf-frame-pointer -mstack-alignment=16 -mstackrealign -fcolor-diagnostics -B/home/maximus/workspaces/work/webrtc/webrtc-checkout/src/third_party/binutils/Linux_x64/Release/bin -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -Wimplicit-fallthrough -Wthread-safety -msse2 -mfpmath=sse -mmmx -m32 --sysroot=/home/maximus/workspaces/work/webrtc/webrtc-checkout/src/build/linux/debian_wheezy_i386-sysroot -O0 -g -funwind-tables -Wnon-virtual-dtor -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -Wnon-virtual-dtor -Woverloaded-virtual -c ../../webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc -o obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.remote_estimator_proxy.o../../third_party/llvm-build/Release+Asserts/bin/clang++: 1: ../../third_party/llvm-build/Release+Asserts/bin/clang++: Syntax error: "(" unexpectedninja: build stopped: subcommand failed.

最佳答案

请检查this article我描述了如何直接构建WebRTC。

下载脚本并运行
https://cs.chromium.org/chromium/src/build/install-build-deps.sh

./build/install-build-deps.sh  --no-chromeos-fonts


$ git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git

$ export PATH=`pwd`/depot_tools:"$PATH"


定义建筑参数

$ export GYP_DEFINES="target_arch=x64 host_arch=x64 build_with_chromium=0 use_openssl=0 use_gtk=0 use_x11=0 include_examples=0 include_tests=1 fastbuild=1 remove_webcore_debug_symbols=1 include_pulse_audio=0 include_internal_video_render=0 clang=1 "


下载源代码

$ mkdir webrtc-checkout
$ cd webrtc-checkout

$ gclient config https://chromium.googlesource.com/external/webrtc.git@branch-heads/50 --name=src
$ gclient sync --force --with_branch_heads
$ gclient sync --force --with_branch_heads --nohooks

$ cd src

$ git checkout branch-heads/50


生成构建脚本

 $ rm -rf ./out/
 $ gclient runhooks


编译

$ ninja -C ./out/Release


现在生成完整的库和标题

$ mkdir ../lib/
$ find  ./ -name "*.o" -and -not -name do_not_use -and -not -name protoc -and -not -name genperf -exec ar crs ../lib/libwebrtc.a {} +

$ mkdir ../include
$ find ./ -name *.h -exec cp --parents '{}' ../include ';'

10-06 14:25