Undefined references with WebRTC

General Tech Bugs & Fixes . 2 years ago

  1   2   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 5 Rating

Posted on 30 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Write Your Comments or Explanations to Help Others



Tuteehub forum answer Answers (2)


profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I'm trying to build peer connection client from WebRTC examples with cmake to use it in my project.

I've included all webrtc libraries and so on to build it, but Im getting always the same issue:

CMakeFiles/webrtcbridge_node.dir/src/webrtcbridge_node.cc.o:(.rodata._ZTI18CustomSocketServer[_ZTI18CustomSocketServer]+0x10): undefined reference to `typeinfo for rtc::PhysicalSocketServer'
CMakeFiles/webrtcbridge_node.dir/src/conductor.cc.o: In function `Conductor::OnMessageFromPeer(int, std::string const&)':
conductor.cc:(.text+0x294d): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::string const&, std::string*)'
conductor.cc:(.text+0x2aed): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::string const&, std::string*)'
conductor.cc:(.text+0x2c01): undefined reference to `webrtc::CreateSessionDescription(std::string const&, std::string const&, webrtc::SdpParseError*)'
conductor.cc:(.text+0x2f46): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::string const&, std::string*)'
conductor.cc:(.text+0x2fa7): undefined reference to `rtc::GetIntFromJsonObject(Json::Value const&, std::string const&, int*)'
conductor.cc:(.text+0x3004): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::string const&, std::string*)'
conductor
                                                    
                                                    
1 views   0 shares
profilepic.png
manpreet 2 years ago

 

This is not a problem with the Json library, rather you are missing some required .a files. For example, the following link error:

conductor.cc:(.text._ZN3rtc9ArrayViewINS_13IntervalRangeELln4711EEC2IS1_EEPT_m[_ZN3rtc9ArrayViewINS_13IntervalRangeELln4711EEC5IS1_EEPT_m]+0xd4): undefined reference to `rtc::FatalMessage::FatalMessage(char const*, int, std::string*)'

indicates you're missing the .a that defines rtc::FatalMessage::FatalMessage.

rtc::FatalMessage::FatalMessage is defined in checks.cc and is built by this BUILD.gn file.

Previously, rtc::FatalMessage::FatalMessage was included in the webrtc_base static library, but it looks like it has been renamed in the most recent versions. It appears that the static library target that contains rtc::FatalMessage::FatalMessage is now rtc_base.

One of the problems with .a files is that they do not have information (like a .so) describing what they depend on, so it's up to you at link time to make sure you get all the required files, which can be a real pain when there are a lot of .a files. If you have the freedom to move away from CMake for you main project, you could integrate with the WebRTC framework's GN build system, which will help you handle linking to the correct dependencies.


1 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community