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

failed to run run_test.sh & link peer connection server #92

Open maxoodf opened 5 years ago

maxoodf commented 5 years ago

Ubuntu 18.04.1 WebRTC 69, 70, 71

g++ -o peerconnection_server main.cc data_socket.cc peer_channel.cc utils.cc $(pkg-config --cflags --libs --define-variable=WEBRTC_LOCAL=/home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64/ libwebrtc_full) /tmp/ccqnQqEA.o: In function main': main.cc:(.text+0x7e4): undefined reference towebrtc::test::CommandLineParser::SetUsageMessage(std::cxx11::basic_string<char, std::char_traits, std::allocator >)' main.cc:(.text+0x86b): undefined reference to `webrtc::test::CommandLineParser::SetFlag(std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator >)' main.cc:(.text+0x91f): undefined reference to `webrtc::test::CommandLineParser::SetFlag(std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator >)' main.cc:(.text+0x9b6): undefined reference to `webrtc::test::CommandLineParser::GetFlag(std::cxx11::basic_string<char, std::char_traits, std::allocator >)' main.cc:(.text+0xa64): undefined reference to webrtc::test::CommandLineParser::GetFlag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /tmp/cc2MbET6.o: In functionrtc::s_url_decode(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)': peer_channel.cc:(.text._ZN3rtc12s_url_decodeERKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN3rtc12s_url_decodeERKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x35): undefined reference to rtc::s_transform(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long (*)(char*, unsigned long, char const*, unsigned long))' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(cxa_exception_storage.o): In functioncxxabiv1::(anonymous namespace)::destruct_(void*)': cxa_exception_storage.cpp:(.text._ZN10cxxabiv112_GLOBALN_19destruct_EPv+0x12): undefined reference to pthread_setspecific' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(cxa_exception_storage.o): In functioncxxabiv1::(anonymous namespace)::construct_()': cxa_exception_storage.cpp:(.text._ZN10__cxxabiv112_GLOBALN_110construct_Ev+0x13): undefined reference to pthread_key_create' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(cxa_exception_storage.o): In functioncxa_get_globals_fast': cxa_exception_storage.cpp:(.text.cxa_get_globals_fast+0x13): undefined reference to `pthread_once' cxa_exception_storage.cpp:(.text.cxa_get_globals_fast+0x23): undefined reference to pthread_getspecific' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(cxa_exception_storage.o): In functioncxa_get_globals': cxa_exception_storage.cpp:(.text.cxa_get_globals+0x41): undefined reference to pthread_setspecific' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(mutex.o): In functionstd::1::mutex::try_lock()': mutex.cpp:(.text._ZNSt315mutex8try_lockEv+0x5): undefined reference to pthread_mutex_trylock' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(mutex.o): In functionstd::1::recursive_mutex::recursive_mutex()': mutex.cpp:(.text._ZNSt3115recursive_mutexC2Ev+0x27): undefined reference to `pthread_mutexattr_init' mutex.cpp:(.text._ZNSt3115recursive_mutexC2Ev+0x49): undefined reference to pthread_mutexattr_settype' mutex.cpp:(.text._ZNSt3__115recursive_mutexC2Ev+0x68): undefined reference topthread_mutexattr_destroy' mutex.cpp:(.text._ZNSt3115recursive_mutexC2Ev+0x74): undefined reference to `pthread_mutexattr_destroy' mutex.cpp:(.text._ZNSt3115recursive_mutexC2Ev+0x81): undefined reference to pthread_mutexattr_destroy' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(mutex.o): In functionstd::1::recursive_mutex::try_lock()': mutex.cpp:(.text._ZNSt3__115recursive_mutex8try_lockEv+0x5): undefined reference to pthread_mutex_trylock' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(mutex.o): In functionstd::1::timed_mutex::try_lock()': mutex.cpp:(.text._ZNSt3111timed_mutex8try_lockEv+0xe): undefined reference to pthread_mutex_trylock' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(mutex.o): In functionstd::1::recursive_timed_mutex::try_lock()': mutex.cpp:(.text._ZNSt3121recursive_timed_mutex8try_lockEv+0x1f): undefined reference to pthread_mutex_trylock' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(memory.o): In functionstd::1::sp_mut::lock()': memory.cpp:(.text._ZNSt318sp_mut4lockEv+0x26): undefined reference to pthread_mutex_trylock' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(condition_variable.o): In functionstd::1::notify_all_at_thread_exit(std::1::condition_variable&, std::__1::unique_lock<std::1::mutex>)': condition_variable.cpp:(.text._ZNSt3125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE+0x1c): undefined reference to `pthread_getspecific' condition_variable.cpp:(.text._ZNSt3125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE+0x2d): undefined reference to pthread_getspecific' condition_variable.cpp:(.text._ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE+0x75): undefined reference topthread_setspecific' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(thread.o): In function std::__1::thread::join()': thread.cpp:(.text._ZNSt3__16thread4joinEv+0x17): undefined reference topthread_join' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(thread.o): In function std::__1::thread::detach()': thread.cpp:(.text._ZNSt3__16thread6detachEv+0x15): undefined reference topthread_detach' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(thread.o): In function std::__1::__thread_local_data()': thread.cpp:(.text._ZNSt3__119__thread_local_dataEv+0x4f): undefined reference topthread_key_create' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(future.o): In function std::__1::__assoc_sub_state::set_value_at_thread_exit()': future.cpp:(.text._ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv+0x91): undefined reference topthread_getspecific' /home/max/Documents/devel/webrtcbuilds/out/webrtcbuilds-23360-350e48a-linux-x64//lib/Release/libwebrtc_full.a(future.o): In function std::__1::__assoc_sub_state::set_exception_at_thread_exit(std::exception_ptr)': future.cpp:(.text._ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr+0x99): undefined reference topthread_getspecific' collect2: error: ld returned 1 exit status

maxoodf commented 5 years ago

Some more info.

Error (one of them) on the peerconnection server linking: std::char_traits<char>, std::allocator<char> > const&)': peer_channel.cc:(.text._ZN3rtc12s_url_decodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN3rtc12s_url_decodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x35): undefined reference to rtc::s_transform(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned long ()(char, unsigned long, char const*, unsigned long))'

and

cd ./out/src/out/Release
cat ./libwebrtc_full.list | grep stringenc
obj/rtc_base/stringutils/stringencode.o
rm ./libwebrtc_full.a
cat libwebrtc_full.list | xargs ar -crs libwebrtc_full.a
nm ./libwebrtc_full.a | grep s_transform
                 U _ZN3rtc11s_transformERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPFmPcmPKcmE
0000000000000000 T _ZN3rtc11s_transformERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPFmPcmPKcmE