webrtc-sdk / libwebrtc

A C++ wrapper for binary release, mainly used for flutter-webrtc desktop (windows, linux, embedded).
MIT License
382 stars 78 forks source link

[build libwebrtc for Linux] libwebrtc/src/rtc_peerconnection_factory_impl.cc:75:112: error: too many arguments to function call, expected single argument 'audio_layer', have 2 arguments #8

Closed kasru closed 2 years ago

kasru commented 3 years ago

source webrtc from (HEAD detached at branch-heads/m74)

I have error for build on Linux Ubuntu 20.04

user@ubuntu:~/work/webrtc-checkout/src$ ninja -C out/Default libwebrtc
ninja: Entering directory `out/Default'
[2439/2648] CXX obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o
FAILED: obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o 
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o.d -DUSE_LIBYUV -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"354873-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=354212 -DCR_LIBCXXABI_REVISION=354284 -D_LIBCPP_ENABLE_NODISCARD -DCR_SYSROOT_HASH=e7c53f04bd88d29d075bfd1f62b073aeb69cbe09 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DHAVE_WEBRTC_VIDEO -I../../libwebrtc -I../../libwebrtc/include -I../.. -Igen -I../../third_party/abseil-cpp -I../../libwebrtc/include -I../../third_party/libyuv/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -fcomplete-member-pointers -m64 -march=x86-64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wc++11-narrowing -Wimplicit-fallthrough -Wthread-safety -Winconsistent-missing-override -Wundef -Wunused-lambda-capture -Wno-shorten-64-to-32 -std=c++11 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_amd64-sysroot -fvisibility-inlines-hidden -Wnon-virtual-dtor -Woverloaded-virtual -c ../../libwebrtc/src/rtc_peerconnection_factory_impl.cc -o obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc:75:112: error: too many arguments to function call, expected single argument 'audio_layer', have 2 arguments
    audio_device_module_ = webrtc::AudioDeviceModule::Create(webrtc::AudioDeviceModule::kPlatformDefaultAudio, nullptr);
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                   ^~~~~~~
../../modules/audio_device/include/audio_device.h:45:3: note: 'Create' declared here
  static rtc::scoped_refptr<AudioDeviceModule> Create(
  ^
1 error generated.
[2444/2648] CXX obj/libwebrtc/libwebrtc/rtc_media_stream_impl.o
ninja: build stopped: subcommand failed.

Please provide me how to build libwebrtc for Linux.

cloudwebrtc commented 3 years ago

It seems that the second parameter (, nullptr) needs to be removed.

cloudwebrtc commented 2 years ago

The latest commit is already working on windows, so I think this issue can be closed.