Как устранить ошибки компоновщика при построении примера однорангового соединения с использованием библиотеки WEBRTC? - PullRequest
0 голосов
/ 05 июня 2019

Я хочу собрать библиотеку Webrtc и использовать ее для создания приложения однорангового соединения с использованием компилятора gcc, но я получаю некоторые ошибки компоновщика. Как устранить эти ошибки компоновщика?

Я пытался создать библиотеку webrtc с помощью команды gn с такими аргументами, как: gn gen out/Release --args='is_debug=false use_custom_libcxx=false use_custom_libcxx_for_host=false rtc_use_h264=true rtc_include_tests=false', но все же я получаю ниже ошибки присоединенного компоновщика.

Я использую Ubuntu 16.04, gcc- 5.4.0 , я попытался понизить версию gcc до 4.8 и построить библиотеку webrtc, но не повезло ...

Building target: Vision_Mixer
Invoking: Cross G++ Linker
g++ -L"/home/intecore/eclipse-workspace/Vision_Mixer/header_files" -pthread -o "Vision_Mixer"  ./linux/main.o ./linux/main_wnd.o  ./conductor.o ./defaults.o ./peer_connection_client.o   -ljsoncpp -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lfontconfig -lfreetype -lglib-2.0 -lgdk-x11-2.0 -lgtk-x11-2.0 -lwebrtc -lX11 -ldl
./linux/main.o: In function `main':
main.cc:(.text.startup+0x1eb): undefined reference to `webrtc::test::ValidateFieldTrialsStringOrDie(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
./linux/main.o:(.rodata._ZTI18CustomSocketServer[_ZTI18CustomSocketServer]+0x10): undefined reference to `typeinfo for rtc::PhysicalSocketServer'
./conductor.o: In function `Conductor::OnSuccess(webrtc::SessionDescriptionInterface*)':
conductor.cc:(.text+0x132a): undefined reference to `Json::Value::operator=(Json::Value const&)'
makefile:45: recipe for target 'Vision_Mixer' failed
conductor.cc:(.text+0x135d): undefined reference to `Json::Value::operator=(Json::Value const&)'
./conductor.o: In function `Conductor::OnIceCandidate(webrtc::IceCandidateInterface const*)':
conductor.cc:(.text+0x1600): undefined reference to `Json::Value::operator=(Json::Value const&)'
conductor.cc:(.text+0x1653): undefined reference to `Json::Value::operator=(Json::Value const&)'
conductor.cc:(.text+0x16c6): undefined reference to `Json::Value::operator=(Json::Value const&)'
./conductor.o: In function `Conductor::AddTracks()':
conductor.cc:(.text+0x1d68): undefined reference to `webrtc::test::VcmCapturer::Create(unsigned long, unsigned long, unsigned long, unsigned long)'
./conductor.o: In function `Conductor::OnMessageFromPeer(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
conductor.cc:(.text+0x3301): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
conductor.cc:(.text+0x3464): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
conductor.cc:(.text+0x36c9): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
conductor.cc:(.text+0x379c): undefined reference to `rtc::GetIntFromJsonObject(Json::Value const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int*)'
conductor.cc:(.text+0x3bf3): undefined reference to `rtc::GetStringFromJsonObject(Json::Value const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
./conductor.o:(.rodata+0xd0): undefined reference to `typeinfo for webrtc::SetSessionDescriptionObserver'
./conductor.o:(.rodata+0x1a0): undefined reference to `typeinfo for webrtc::VideoTrackSource'
./conductor.o:(.rodata._ZTI9Conductor[_ZTI9Conductor]+0x28): undefined reference to `typeinfo for webrtc::CreateSessionDescriptionObserver'
./peer_connection_client.o:(.rodata._ZTI20PeerConnectionClient[_ZTI20PeerConnectionClient]+0x28): undefined reference to `typeinfo for rtc::MessageHandler'
collect2: error: ld returned 1 exit status
...