Closed CharlieHollow closed 7 years ago
Hello,
For the GTK issue, could you try with ${GTK3_LIBRARIES}
instead of ${GTK_LIBRARIES}
?
For the pkg-config issue, I'm not sure, please run the pkg-config --list-all
command and tell me if you can see LibWebRTC in the list by pasting the whole line, the spelling might be wrong.
Hi @aisouard,
thank you so much for your answer.
In first place, I've tried ${GTK3_LIBRARIES}
instead of ${GTK_LIBRARIES}
and it fixed that dependence.
About LibWebRTC, I 've run on terminal $ pkg-config --list-all | grep LibWebRTC
and I got:
LibWebRTC - Google's native WebRTC implementation shipped into a single library
So, in effect, pkg-config recognizes it.
I run on terminal:
$ pkg-config --libs LibWebRTC
and I got:
-L/usr/local/lib -lwebrtc -lSM -lICE -lX11 -lXext -ldl -lrt
and the problem, I think, could be in -lwebrtc
, because trying to build the client with gcc, gcc could not locate that library
Perhaps you should try with g++
, are you sure that libwebrtc.a is located inside the /usr/local/lib
folder ?
I'm using cmake to build my project anyway.
And libwebrtc.a is in ~/libwebrtc/out/lib
which is the installation folder. But when I run $ sudo make install
it did not install the library in /usr/local/lib
folder, so I supposed it was in the correct location
Edit: I have copied libwebrtc.a in /usr/local/lib
and the problem persists
if -lwebrtc does not work it means at least one of the following: 1 - "webrtc" is the wrong spelling for your lib (often) 2 - "webrtc" is the right spelling, but the lib has different arch (rare, and usually triggers a different error message) 3 - the lib is not in your LIBPATH (most likely)
the fastest way to check if you have the right lib is to manually relocate the lib in the build_directory of your cmake project. If your project is made of multiple sub directories, it will be in the build directory corresponding to the sub directory of the CMakeLists.txt which called "add_executable" on the target linking libwebrtc, with respect to the root, i.e. the top-most CMakeLists.txt used by the current cmake process.
you move the lib there, if it compiles, the lib itself is ok in terms of architecture, symbols contained, and naming, and you have a LIBPATH problem.
On Tue, Aug 29, 2017 at 5:29 PM, CharlieHollow notifications@github.com wrote:
I'm using cmake to build my project anyway.
And libwebrtc.a is in ~/libwebrtc/out/lib which is the installation folder. But when I run $ sudo make install it did install the library in /usr/local/lib folder, so I supposed it was in the correct location
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aisouard/libwebrtc/issues/51#issuecomment-325608743, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT1nsv5tmfaE8RqXvwECrMAvWUcy1jTks5sc9oDgaJpZM4PEeRn .
sg.linkedin.com/agouaillard
-
Hi @agouaillard, thanks for your answer as well.
I'm not secure what do you mean in your first option. The name of the library is libwebrtc.a
, as is defined by default.
About third option, I've relocated the library in build folder and other folders as well with no result.
Even I've tried to add to CMakeList.txt this lines to link the library:
link_directories(~/libwebrtc/out/lib)
target_link_libraries(${PROJECT_NAME}_node libwebrtc.a)
but it does not fix the problem either.
Hi again @aisouard @agouaillard,
finally I solved these problems, adding some missing libraries as JSONCPP and missing files as main_wnd.cc, conductor.cc, etc.
However, I'm still getting this error, due to one or two missing libraries I think, but I can't find them out.
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+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*)'
CMakeFiles/webrtcbridge_node.dir/src/peer_connection_client.cc.o:(.rodata._ZTI20PeerConnectionClient[_ZTI20PeerConnectionClient]+0x28): undefined reference to`typeinfo for rtc::MessageHandler'
Which could be these libraries? Or it is another problem?
Thanks again.
webrtc/rtc_base/json.cpp
On Fri, Sep 8, 2017 at 10:37 AM, CharlieHollow notifications@github.com wrote:
Hi again @aisouard https://github.com/aisouard @agouaillard https://github.com/agouaillard,
finally I solved these problems, adding some missing libraries as JSONCPP and missing files as main_wnd.cc, conductor.cc, etc.
However, I'm still getting this error, due to one or two missing libraries I think, but I can't find them out.
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 tortc::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+0x2f46): undefined reference to`rtc::GetStringFromJsonObject(Json::Value const&, std::string const&, std::string)' conductor.cc:(.text+0x2fa7): undefined reference tortc::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*)' CMakeFiles/webrtcbridge_node.dir/src/peer_connection_client.cc.o:(.rodata._ZTI20PeerConnectionClient[_ZTI20PeerConnectionClient]+0x28): undefined reference to`typeinfo for rtc::MessageHandler'Which could be these libraries? Or it is another problem?
Thanks again.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aisouard/libwebrtc/issues/51#issuecomment-328040513, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT1nr4MVNLNbq3orYWhKxYqKV6P5NPlks5sgPzOgaJpZM4PEeRn .
sg.linkedin.com/agouaillard
-
Thank you so much @agouaillard
I have added from webrtc/base/ as well:
If you use /base/ You re using an old version ;-)
Sent from my iPhone
On 8 Sep 2017, at 10:58 AM, CharlieHollow notifications@github.com wrote:
Closed #51.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Okaay! Thanks again! :D
I have read this discussion and is helpful so far. @CharlieHollow Do you still have the updated CMakeList.txt If so . Can you share it ?
Hi @sampathkumar81293,
yes, I do. This is a simplify version of my CMakeLists.txt:
cmake_minimum_required(VERSION 3.3)
project(sample)
#add_compile_options(-std=c++11)
# Importing WebRTC Libraries
find_package(LibWebRTC REQUIRED)
include(${LIBWEBRTC_USE_FILE})
# Include JSONCPP libraries for JSON dependences
find_library(JSONCPP_LIBRARIES jsoncpp HINTS /usr/lib/x86_64-linux-gnu)
#Include header files
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${LIBWEBRTC_INCLUDE_DIRS})
set(JSON_INCLUDE_DIRS "/usr/include/jsoncpp")
include_directories(${JSON_INCLUDE_DIRS})
set(JSONCPP ~/libwebrtc/out/webrtc/src/build/linux/debian_jessie_amd64-sysroot/usr/lib/libjsoncpp.so)
# Find source files
file(GLOB SOURCES src/*.cpp src/*.cc)
add_executable(${PROJECT_NAME} ${SOURCES})
# Adding dependences
target_link_libraries(${PROJECT_NAME}
${LIBWEBRTC_LIBRARIES}
${JSONCPP_LIBRARIES}
${JSONCPP}
)
I don't know why, but I had to include two different json libraries to fix that problem.
By the way, what's your issue?
@CharlieHollow Thanks to you, this fixed my json/json.h errors :+1:
I was trying to build this [(https://github.com/llamerada-jp/webrtc-cpp-sample/blob/master/main.cpp)]
But my issue is that it ends up with this error
main.cpp:(.text+0x1ff): undefined reference to rtc::MessageQueue::set_socketserver(rtc::SocketServer*)
main.cpp:(.text+0x230): undefined reference to rtc::MessageQueue::set_socketserver(rtc::SocketServer*)
May be MessageQueue.cc / .h no longer has ser_sockerserver() method ?
Thanks again :)
Hi @sampathkumar81293,
if I remember well, "SocketServer" class is included in main.cc on WebRTC peer connection example, at the beginning of the .cc file.
Maybe you forgot to include it in your main.cpp file.
Try it and tell me if this fixes your problem.
You're welcome!
Hi @CharlieHollow
It was completely my fault . The recent webrtc no longer uses set_socketserver() function.For eg
This snippet
CustomSocketServer socket_server(thread, &wnd);
thread->set_socketserver(&socket_server);
is changed to
CustomSocketServer socket_server(&wnd);
rtc::AutoSocketServerThread thread(&socket_server);
and other set_socketserver() usages has been omitted.
Thanks :)
Hi @CharlieHollow and @agouaillard
We are facing the same linker issues:
undefined reference to typeinfo for rtc::PhysicalSocketServe
undefined reference to rtc::GetStringFromJsonObject
undefined reference to rtc::GetIntFromJsonObject
undefined reference to typeinfo for webrtc::SetSessionDescriptionObserver
undefined reference to typeinfo for webrtc::CreateSessionDescriptionObserver
undefined reference to typeinfo for rtc::AdaptedVideoTrackSource
undefined reference to typeinfo for rtc::MessageHandler
so for this we have added following source files to resolve these linker issue:
After this project gets build successfully but when we try to run it it gives us an error:
Fatal error in: ../src/physical_socket_server.cc, line 1423
last system error: 11
Check failed: !processing_dispatchers_
Is this because of the mismatch sources ? but we used the sources from same webrtc cloned sources.
What is the stable latest webrtc source directory from where we can download ? and build webrtc library, so that we dont have to add above sources additionally.
Thanks in advance !
@coreTechie007 were you able to solve the issue with jsep? or did you have to move to another version of webrtc?
Hi,
I'm working with WebRTC on Ubuntu 16.04, installed as you explain.
My problem is when I try to build client peerconnection with cmake, I get:
This is my CMakeLists.txt
Trying to find out where is the problem, I've tried to build with gcc, and when I use pkg-config with LibWebRTC, it returns this error:
Any idea? Thanks