sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.32k stars 350 forks source link

Errors building Libsourcey with webrtc #212

Closed Biancakr closed 6 years ago

Biancakr commented 6 years ago

Hi!

I'm trying to build LibSourcey with WebRTC on a Raspberry Pi. I accomplished to build WebRTC, branch 59, on the Raspberry, by using the webrtc-build from your git. However I was not able to build LibSourcey on the Raspberry.

After this I decided to build WebRTC and Libsourcey on the PC with a Linux distibution (17.04) After building WebRTC, branch 59 through the webrtc-build, for the PC succesfully, I tried to build LibSourcey on the PC.

Howerver, when building LibSourcey I got a lot of errors. (similair to the errors of the Raspberry)

I posted a couple of the errors in the link below: https://pastebin.com/bdnXcfQr

The errors: "undefined reference to" webrtc::metrics::HistogramAdd webrtc::metrics::HistogramFactoryGetCounts webrtc::metrics::GetHistogramName are repeated over and over.

Build webrtc-build: ./build.sh -b branch-heads/59 -l jsoncpp -e -d

Build libsourcey: cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SHARED_LIBS=OFF \ -DBUILD_APPLICATIONS=OFF -DBUILD_MODULES=OFF \ -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON \ -DWITH_FFMPEG=ON -DWITH_OPENCV=OFF \ -DWITH_WEBRTC=ON -DBUILD_MODULE_archo=ON \ -DBUILD_MODULE_base=ON -DBUILD_MODULE_crypto=ON \ -DBUILD_MODULE_http=ON -DBUILD_MODULE_json=ON \ -DBUILD_MODULE_av=ON -DBUILD_MODULE_net=ON \ -DBUILD_MODULE_pacm=ON -DBUILD_MODULE_pluga=ON \ -DBUILD_MODULE_sked=ON -DBUILD_MODULE_socketio=ON \ -DBUILD_MODULE_stun=ON -DBUILD_MODULE_symple=ON \ -DBUILD_MODULE_turn=ON -DBUILD_MODULE_util=ON \ -DBUILD_MODULE_uv=ON -DBUILD_MODULE_webrtc=ON \ -DWEBRTC_ROOT_DIR=/dir/to/prebuild_webrtc

I hope you can help me solve these issues. Thanks in advance!

brtwrs commented 6 years ago

Hi all! Thanks for the great project! Sadly I'm getting the same errors as Biancakr when I try to compile libsourcey with my own compiled webrtc library (linking errors in the webtrcstreamer example). When I use the precompiled webrtc library it works perfectly but I need to use my own compiled webrtc library. I followed the instructions to the letter. Im on ubuntu 16.10 btw. I really hope you can help me:)

auscaster commented 6 years ago

Hey guys, look like you aren't the first ones to experience this with WebRTC, check here: https://groups.google.com/forum/#!topic/discuss-webrtc/3-nnqY9TZsc

Looks like the histogram symbols are defined in: system_ wrappers/field_trial_default/field_trial_default.o

Hope this helps!

On 30 January 2018 at 08:26, brtwrs notifications@github.com wrote:

Hi all! Thanks for the great project! Sadly I'm getting the same errors as Biancakr when I try to compile libsourcey with my own compiled webrtc library (linking errors in the webtrcstreamer example). When I use the precompiled webrtc library it works perfectly but I need to use my own compiled webrtc library. I followed the instructions to the letter. Im on ubuntu 16.10 btw. I really hope you can help me:)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sourcey/libsourcey/issues/212#issuecomment-361500004, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGKDLAQCNjvha7wius0_EtFUj26934Vks5tPsQfgaJpZM4RoG2e .

Biancakr commented 6 years ago

Thanks for your reply. Unfortunately, the link you provided did not solve my issue. I still receive the same errors as I did previously.

I was wondering if these errors were produced by compiling webrtc wrongly, or if LibSourcey is linking the libraries wrong, in my current configuration?

Hopefully you can help me.

auscaster commented 6 years ago

Its must be to do with your compiled webrtc library since the precompiled libs are working. Are you compiling and linking with the monolythic webrtc lib (webrtc_full.a) or individual libs? Can you let me know which webrtc libs you are linking with and in which order they show up and perhaps I can help.

On 1 February 2018 at 09:50, Biancakr notifications@github.com wrote:

Thanks for your reply. Unfortunately, the link you provided did not solve my issue. I still receive the same errors as I did previously.

I was wondering if these errors were produced by compiling webrtc wrongly, or if LibSourcey is linking the libraries wrong, in my current configuration?

Hopefully you can help me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sourcey/libsourcey/issues/212#issuecomment-362198637, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGKDOH6Nb9ag9V4EM9ubeverSwk3FSoks5tQXrlgaJpZM4RoG2e .

Biancakr commented 6 years ago

I am compiling and linking it to individual libraries. The architecture of my webrtc-build library files/dirs is as follow:

lib/
└── x64
    ├── Debug
    │   ├── libboringssl.a
    │   ├── libcpu_features_linux.a
    │   ├── libfield_trial_default.a
    │   ├── libjingle_peerconnection.a
    │   ├── libmetrics_default.a
    │   ├── libprotobuf_full.a
    │   ├── libprotobuf_lite.a
    │   ├── libprotoc_lib.a
    │   ├── libsystem_wrappers.a
    │   ├── libwebrtc.a
    │   └── pkgconfig
    │       └── libwebrtc_full.pc
    └── Release
        ├── libboringssl.a
        ├── libcpu_features_linux.a
        ├── libfield_trial_default.a
        ├── libjingle_peerconnection.a
        ├── libmetrics_default.a
        ├── libprotobuf_full.a
        ├── libprotobuf_lite.a
        ├── libprotoc_lib.a
        ├── libsystem_wrappers.a
        ├── libwebrtc.a
        └── pkgconfig
            └── libwebrtc_full.pc

This architecture is automaticly provided by running the command: ./build.sh -b branch-heads/59 -l jsoncpp -e -d

When compiling LibSourcey's webrtc streamer, I used the following command:

make -f webrtc/samples/webrtcstreamer/CMakeFiles/webrtcstreamer.dir/build.make webrtc/samples/webrtcstreamer/CMakeFiles/webrtcstreamer.dir/build
webrtc/samples/webrtcstreamer/CMakeFiles/webrtcstreamer.dir/build.make:318: update target 'webrtc/samples/webrtcstreamer/webrtcstreamer' due to: webrtc/samples/webrtcstreamer/CMakeFiles/webrtcstreamer.dir/link.txt webrtc/samples/webrtcstreamer/CMakeFiles/webrtcstreamer.dir/main.cpp.o webrtc/samples/webrtcstreamer/CMakeFiles/webrtcstreamer.dir/signaler.cpp.o webrtc/samples/webrtcstreamer/CMakeFiles/webrtcstreamer.dir/build.make 
base/libscy_base.a 
crypto/libscy_crypto.a 
av/libscy_av.a 
net/libscy_net.a 
http/libscy_http.a 
util/libscy_util.a 
json/libscy_json.a 
socketio/libscy_socketio.a 
symple/libscy_symple.a 
webrtc/libscy_webrtc.a 
../prebuild_webrtc/lib/x64/Release/libwebrtc.a 
/usr/lib/x86_64-linux-gnu/libswresample.so
/usr/lib/x86_64-linux-gnu/libavresample.so 
/usr/lib/x86_64-linux-gnu/libavformat.so 
/usr/lib/x86_64-linux-gnu/libavcodec.so 
/usr/lib/x86_64-linux-gnu/libswscale.so 
/usr/lib/x86_64-linux-gnu/libavutil.so 
/usr/lib/x86_64-linux-gnu/libavfilter.so 
/usr/lib/x86_64-linux-gnu/libavdevice.so 
/usr/lib/x86_64-linux-gnu/libpostproc.so 
/usr/lib/x86_64-linux-gnu/libbz2.so 
/usr/lib/x86_64-linux-gnu/liblzma.so 
/usr/lib/x86_64-linux-gnu/libva.so 
/usr/lib/x86_64-linux-gnu/libvorbis.so 
/usr/lib/x86_64-linux-gnu/libvorbisenc.so 
/usr/lib/x86_64-linux-gnu/libtheora.so 
/usr/lib/x86_64-linux-gnu/libogg.so vendor
/libuv/liblibuv.a 
vendor/minizip/libminizip.a 
vendor/http_parser/libhttp_parser.a 
vendor/zlib/libzlib.so.1.2.8

I also tried with more libraries of webrtc:

make -f 
......
webrtc/libscy_webrtc.a 
../prebuild_webrtc/lib/x64/Release/libfield_trial_default.a 
../prebuild_webrtc/lib/x64/Release/libmetrics_default.a 
../prebuild_webrtc/lib/x64/Release/libjingle_peerconnection.a 
../prebuild_webrtc/lib/x64/Release/libsystem_wrappers.a 
../prebuild_webrtc/lib/x64/Release/libboringssl.a 
../prebuild_webrtc/lib/x64/Release/libwebrtc.a 
........
vendor/zlib/libzlib.so.1.2.8

And with all of the libraries:

make -f 
.... 
webrtc/libscy_webrtc.a 
../prebuild_webrtc/lib/x64/Release/libfield_trial_default.a 
../prebuild_webrtc/lib/x64/Release/libmetrics_default.a 
../prebuild_webrtc/lib/x64/Release/libjingle_peerconnection.a 
../prebuild_webrtc/lib/x64/Release/libsystem_wrappers.a 
../prebuild_webrtc/lib/x64/Release/libboringssl.a 
../prebuild_webrtc/lib/x64/Release/libcpu_features_linux.a 
../prebuild_webrtc/lib/x64/Release/libprotobuf_full.a 
../prebuild_webrtc/lib/x64/Release/libprotobuf_lite.a 
../prebuild_webrtc/lib/x64/Release/libprotoc_lib.a 
../prebuild_webrtc/lib/x64/Release/libwebrtc.a
.......
vendor/zlib/libzlib.so.1.2.8
auscaster commented 6 years ago

Histogram is no longer required be default in later WebRTC builds, so I'll close this for now.