Build Peerconnection with WebRTC static library failed

554 views Asked by At

I met some issues when I wanted to build the peerconnection example with linking Webrtc as a static library.

My build environment and the target are both ubuntu 18.04, and I used the Github repo https://github.com/vsimon/webrtcbuilds to build the Webrtc as a static library.

Then there were many link errors about absl libray, after some investigations, I added some build args to eliminate the majority of them as below:

is_debug=false
is_component_build=false
is_clang=false
rtc_include_tests=false
rtc_use_h264=true
rtc_enable_protobuf=false
use_rtti=true
use_custom_libcxx=false
treat_warnings_as_errors=false
use_ozone=true

But it still has several link errors that I can't tackle:

/home/alexander/works/lab/webrtc-native/test_project/peerconnection/lib/Release/libwebrtc_full.a(mutex.o): In function `absl::DeadlineFromTimeout(absl::Duration) [clone .isra.8]':
mutex.cc:(.text._ZN4abslL19DeadlineFromTimeoutENS_8DurationE.isra.8+0x24): undefined reference to `absl::TimeFromTimeval(timeval)'
/home/alexander/works/lab/webrtc-native/test_project/peerconnection/lib/Release/libwebrtc_full.a(mutex.o): In function `absl::Mutex::AwaitWithDeadline(absl::Condition const&, absl::Time)':
mutex.cc:(.text._ZN4absl5Mutex17AwaitWithDeadlineERKNS_9ConditionENS_4TimeE+0xa4): undefined reference to `absl::ToUnixNanos(absl::Time)'
/home/alexander/works/lab/webrtc-native/test_project/peerconnection/lib/Release/libwebrtc_full.a(mutex.o): In function `absl::Mutex::LockWhenWithDeadline(absl::Condition const&, absl::Time)':
mutex.cc:(.text._ZN4absl5Mutex20LockWhenWithDeadlineERKNS_9ConditionENS_4TimeE+0x27): undefined reference to `absl::ToUnixNanos(absl::Time)'
/home/alexander/works/lab/webrtc-native/test_project/peerconnection/lib/Release/libwebrtc_full.a(mutex.o): In function `absl::Mutex::ReaderLockWhenWithDeadline(absl::Condition const&, absl::Time)':
mutex.cc:(.text._ZN4absl5Mutex26ReaderLockWhenWithDeadlineERKNS_9ConditionENS_4TimeE+0x27): undefined reference to `absl::ToUnixNanos(absl::Time)'
/home/alexander/works/lab/webrtc-native/test_project/peerconnection/lib/Release/libwebrtc_full.a(mutex.o): In function `absl::CondVar::WaitWithDeadline(absl::Mutex*, absl::Time)':
mutex.cc:(.text._ZN4absl7CondVar16WaitWithDeadlineEPNS_5MutexENS_4TimeE+0x27): undefined reference to `absl::ToUnixNanos(absl::Time)'
/home/alexander/works/lab/webrtc-native/test_project/peerconnection/lib/Release/libwebrtc_full.a(bind.o): In function `absl::str_format_internal::FormatUntyped(absl::str_format_internal::FormatRawSinkImpl, absl::str_format_internal::UntypedFormatSpecImpl, absl::Span<absl::str_format_internal::FormatArgImpl const>)':
bind.cc:(.text._ZN4absl19str_format_internal13FormatUntypedENS0_17FormatRawSinkImplENS0_21UntypedFormatSpecImplENS_4SpanIKNS0_13FormatArgImplEEE+0x159): undefined reference to `absl::str_format_internal::kTags'
bind.cc:(.text._ZN4absl19str_format_internal13FormatUntypedENS0_17FormatRawSinkImplENS0_21UntypedFormatSpecImplENS_4SpanIKNS0_13FormatArgImplEEE+0x457): undefined reference to `absl::str_format_internal::ConsumeUnboundConversion(char const*, char const*, absl::str_format_internal::UnboundConversion*, int*)'
/home/alexander/works/lab/webrtc-native/test_project/peerconnection/lib/Release/libwebrtc_full.a(bind.o): In function `absl::str_format_internal::Summarize[abi:cxx11](absl::str_format_internal::UntypedFormatSpecImpl, absl::Span<absl::str_format_internal::FormatArgImpl const>)':
bind.cc:(.text._ZN4absl19str_format_internal9SummarizeB5cxx11ENS0_21UntypedFormatSpecImplENS_4SpanIKNS0_13FormatArgImplEEE+0x18b): undefined reference to `absl::str_format_internal::kTags'
bind.cc:(.text._ZN4absl19str_format_internal9SummarizeB5cxx11ENS0_21UntypedFormatSpecImplENS_4SpanIKNS0_13FormatArgImplEEE+0xa12): undefined reference to `absl::str_format_internal::ConsumeUnboundConversion(char const*, char const*, absl::str_format_internal::UnboundConversion*, int*)'

I hope anyone can give me some hints to fix them, thanks very much!

0

There are 0 answers