I’m trying to build mediasoup-broadcaster-demo and run into linker errors. I’ve a working libwebrtc m74 build.
[ 80%] Linking CXX executable broadcaster
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > cricket::ToStringIfSet<bool>(char const*, absl::optional<bool> const&)':
Broadcaster.cpp:(.text+0x321f): undefined reference to `rtc::ToString[abi:cxx11](bool)'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > cricket::ToStringIfSet<int>(char const*, absl::optional<int> const&)':
Broadcaster.cpp:(.text+0x338f): undefined reference to `rtc::ToString[abi:cxx11](int)'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o: In function `mediasoupclient::PeerConnection::RTCStatsCollectorCallback::OnStatsDelivered(rtc::scoped_refptr<webrtc::RTCStatsReport const> const&)':
Broadcaster.cpp:(.text._ZN15mediasoupclient14PeerConnection25RTCStatsCollectorCallback16OnStatsDeliveredERKN3rtc13scoped_refptrIKN6webrtc14RTCStatsReportEEE[_ZN15mediasoupclient14PeerConnection25RTCStatsCollectorCallback16OnStatsDeliveredERKN3rtc13scoped_refptrIKN6webrtc14RTCStatsReportEEE]+0x4a): undefined reference to `webrtc::RTCStatsReport::ToJson[abi:cxx11]() const'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.data.rel.ro._ZTVN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE[_ZTVN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE]+0x40): undefined reference to `webrtc::CreateSessionDescriptionObserver::OnFailure(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.data.rel.ro._ZTVN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE[_ZTVN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE]+0x40): undefined reference to `webrtc::SetSessionDescriptionObserver::OnFailure(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.data.rel.ro._ZTIN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE[_ZTIN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE]+0x10): undefined reference to `typeinfo for webrtc::CreateSessionDescriptionObserver'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.data.rel.ro._ZTIN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE[_ZTIN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE]+0x10): undefined reference to `typeinfo for webrtc::SetSessionDescriptionObserver'
CMakeFiles/broadcaster.dir/src/main.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > cricket::ToStringIfSet<bool>(char const*, absl::optional<bool> const&)':
...
This looks to me like a gcc/clang stdlib issue. I get this error both with a libwebrtc build with clang and gcc. Switching to clang for the mediasoup-broadcaster-demo build gives me slightly different errors
[ 80%] Linking CXX executable broadcaster
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o: In function `mediasoupclient::PeerConnection::RTCStatsCollectorCallback::OnStatsDelivered(rtc::scoped_refptr<webrtc::RTCStatsReport const> const&)':
Broadcaster.cpp:(.text._ZN15mediasoupclient14PeerConnection25RTCStatsCollectorCallback16OnStatsDeliveredERKN3rtc13scoped_refptrIKN6webrtc14RTCStatsReportEEE[_ZN15mediasoupclient14PeerConnection25RTCStatsCollectorCallback16OnStatsDeliveredERKN3rtc13scoped_refptrIKN6webrtc14RTCStatsReportEEE]+0x2f): undefined reference to `webrtc::RTCStatsReport::ToJson[abi:cxx11]() const'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.rodata._ZTVN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE[_ZTVN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE]+0x40): undefined reference to `webrtc::SetSessionDescriptionObserver::OnFailure(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.rodata._ZTIN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE[_ZTIN15mediasoupclient14PeerConnection29SetSessionDescriptionObserverE]+0x10): undefined reference to `typeinfo for webrtc::SetSessionDescriptionObserver'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.rodata._ZTVN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE[_ZTVN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE]+0x40): undefined reference to `webrtc::CreateSessionDescriptionObserver::OnFailure(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/broadcaster.dir/src/Broadcaster.cpp.o:(.rodata._ZTIN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE[_ZTIN15mediasoupclient14PeerConnection32CreateSessionDescriptionObserverE]+0x10): undefined reference to `typeinfo for webrtc::CreateSessionDescriptionObserver'
CMakeFiles/broadcaster.dir/src/peerConnectionUtils.cpp.o: In function `createPeerConnectionFactory()':
peerConnectionUtils.cpp:(.text+0x430): undefined reference to `rtc::Thread::SetName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void const*)'
...
Any hints of how to complete this build successfully?
Thanks!
Robert