vsimon / webrtcbuilds

Getting started with WebRTC natively is no easy picnic. The goal of webrtcbuilds is to provide a single standalone WebRTC static library and package.
BSD 3-Clause "New" or "Revised" License
202 stars 164 forks source link

Link errors with webrtcbuilds-15043-74f9d98-linux-x64 using clang #41

Closed robagar closed 1 year ago

robagar commented 7 years ago

Having built WebRTC r74f9d98 with clang, I'm now getting a whole bunch of linker errors for various things that should be in _libwebrtcfull.a:

Linking libeawebrtc.so
mkdir -p lib
/home/rob/libs/webrtcbuilds/out/src/third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -fuse-ld=gold -B/home/rob/libs/webrtcbuilds/out/src/third_party/binutils/Linux_x64/Release/bin -Wl,--disable-new-dtags -m64 -Wl,--detect-odr-violations -Wl,--icf=all -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections  -shared -o lib/libeawebrtc.so -Wl,--start-group obj/libeawebrtc.o obj/PeerConnectionImpl.o obj/DataChannelImpl.o obj/EAVideoTrackSource.o obj/MJPEGVideoTrackSource.o obj/RawVideoTrackSource.o /home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a  -Wl,--end-group -ldl -lX11
/home/rob/libs/webrtcbuilds/out/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: error: /home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(circular_buffer.o): multiple definition of 'webrtc::CircularBuffer::~CircularBuffer()'
/home/rob/libs/webrtcbuilds/out/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: /home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(utility.o): previous definition here
/home/rob/libs/webrtcbuilds/out/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: error: /home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(circular_buffer.o): multiple definition of 'webrtc::CircularBuffer::~CircularBuffer()'
/home/rob/libs/webrtcbuilds/out/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: /home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(utility.o): previous definition here
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_codec_impl.o):../../webrtc/voice_engine/voe_codec_impl.cc:function webrtc::VoECodecImpl::SetSendCodec(int, webrtc::CodecInst const&): error: undefined reference to 'webrtc::voe::Statistics::Initialized() const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_codec_impl.o):../../webrtc/voice_engine/voe_codec_impl.cc:function webrtc::VoECodecImpl::GetSendCodec(int, webrtc::CodecInst&): error: undefined reference to 'webrtc::voe::Statistics::Initialized() const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_codec_impl.o):../../webrtc/voice_engine/voe_codec_impl.cc:function webrtc::VoECodecImpl::SetBitRate(int, int): error: undefined reference to 'webrtc::voe::Statistics::Initialized() const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_codec_impl.o):../../webrtc/voice_engine/voe_codec_impl.cc:function webrtc::VoECodecImpl::GetRecCodec(int, webrtc::CodecInst&): error: undefined reference to 'webrtc::voe::Statistics::Initialized() const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_audio_processing_impl.o):../../webrtc/voice_engine/voe_audio_processing_impl.cc:function webrtc::VoEAudioProcessingImpl::SetTypingDetectionParameters(int, int, int, int, int): error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int, webrtc::TraceLevel) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(transmit_mixer.o):../../webrtc/voice_engine/transmit_mixer.cc:function webrtc::voe::TransmitMixer::RegisterVoiceEngineObserver(webrtc::VoiceEngineObserver&): error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int, webrtc::TraceLevel, char const*) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(transmit_mixer.o):../../webrtc/voice_engine/transmit_mixer.cc:function webrtc::voe::TransmitMixer::StartPlayingFileAsMicrophone(char const*, bool, webrtc::FileFormats, int, float, int, webrtc::CodecInst const*): error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int, webrtc::TraceLevel, char const*) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(transmit_mixer.o):../../webrtc/voice_engine/transmit_mixer.cc:function webrtc::voe::TransmitMixer::StartPlayingFileAsMicrophone(char const*, bool, webrtc::FileFormats, int, float, int, webrtc::CodecInst const*): error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int, webrtc::TraceLevel, char const*) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(transmit_mixer.o):../../webrtc/voice_engine/transmit_mixer.cc:function webrtc::voe::TransmitMixer::StartPlayingFileAsMicrophone(char const*, bool, webrtc::FileFormats, int, float, int, webrtc::CodecInst const*): error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int, webrtc::TraceLevel, char const*) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_base_impl.o):../../webrtc/voice_engine/voe_base_impl.cc:function webrtc::VoEBaseImpl::TerminateInternal(): error: undefined reference to 'webrtc::voe::Statistics::SetUnInitialized()'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_base_impl.o):../../webrtc/voice_engine/voe_base_impl.cc:function webrtc::VoEBaseImpl::Init(webrtc::AudioDeviceModule*, webrtc::AudioProcessing*, rtc::scoped_refptr<webrtc::AudioDecoderFactory> const&): error: undefined reference to 'webrtc::voe::Statistics::SetInitialized()'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(voe_base_impl.o):../../webrtc/voice_engine/voe_base_impl.cc:function webrtc::VoEBaseImpl::LastError(): error: undefined reference to 'webrtc::voe::Statistics::LastError() const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(channel.o):../../webrtc/voice_engine/channel.cc:function webrtc::voe::Channel::OnInitializeDecoder(signed char, char const*, int, unsigned long, unsigned int): error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(shared_data.o):../../webrtc/voice_engine/shared_data.cc:function webrtc::voe::SharedData::SharedData(): error: undefined reference to 'webrtc::voe::Statistics::Statistics(unsigned int)'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(shared_data.o):../../webrtc/voice_engine/shared_data.cc:function webrtc::voe::SharedData::~SharedData(): error: undefined reference to 'webrtc::voe::Statistics::~Statistics()'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(shared_data.o):../../webrtc/voice_engine/shared_data.cc:function webrtc::voe::SharedData::SetLastError(int) const: error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(shared_data.o):../../webrtc/voice_engine/shared_data.cc:function webrtc::voe::SharedData::SetLastError(int, webrtc::TraceLevel) const: error: undefined reference to 'webrtc::voe::Statistics::SetLastError(int, webrtc::TraceLevel) const'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(rtcp_receiver.o):../../webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc:function webrtc::RTCPReceiver::ParseCompoundPacket(unsigned char const*, unsigned char const*, webrtc::RTCPReceiver::PacketInformation*): error: undefined reference to 'vtable for webrtc::rtcp::Remb'
/home/rob/libs/webrtcbuilds/out/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(rtcp_receiver.o):../../webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc:function webrtc::RTCPReceiver::ParseCompoundPacket(unsigned char const*, unsigned char const*, webrtc::RTCPReceiver::PacketInformation*): error: undefined reference to 'webrtc::rtcp::Remb::Parse(webrtc::rtcp::CommonHeader const&)'
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(rtcp_sender.o):../../webrtc/modules/rtp_rtcp/source/rtcp_sender.cc:function webrtc::RTCPSender::BuildREMB(webrtc::RTCPSender::RtcpContext const&): error: undefined reference to 'vtable for webrtc::rtcp::Remb'
/home/rob/libs/webrtcbuilds/out/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/home/rob/libs/webrtcbuilds/out/webrtcbuilds-15043-74f9d98-linux-x64/lib/Release/libwebrtc_full.a(rtcp_sender.o):../../webrtc/modules/rtp_rtcp/source/rtcp_sender.cc:function webrtc::RTCPSender::BuildREMB(webrtc::RTCPSender::RtcpContext const&): error: undefined reference to 'webrtc::rtcp::Remb::SetSsrcs(std::vector<unsigned int, std::allocator<unsigned int> >)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
robagar commented 7 years ago

The CircularBuffer destructor error is due to it being defined in two source files:

robagar commented 7 years ago

The Statisitics class code is in _webrtc/voiceengine/statistics.cc, which AFAICS should be compiled in as part of the _voiceengine library.

robagar commented 7 years ago

Remb is in _webrtc/modules/rtp_rtcp/source/rtcppacket/remb.cc, in the _rtprtcp library.

getkey commented 7 years ago

We had this problem at markandrus/build-webrtc#2. Since libwebrtc_full.a doesn't need to include tests classes that cause this problem, you can just not build them by specifying the rtc_include_tests switch: gn gen --args='rtc_include_tests=false'.