meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.15k stars 2.47k forks source link

Build of streaming plugin is failed #1887

Closed kuzm1ch closed 4 years ago

kuzm1ch commented 4 years ago

Affected version

This is working fine for version 7.4, but for 7.6 and the latest master build of streaming plugin is failed.

Logs:

  CC       plugins/plugins_libjanus_streaming_la-janus_streaming.lo
plugins/janus_streaming.c: In function 'janus_streaming_rtsp_connect_to_server':
plugins/janus_streaming.c:5709:26: error: missing binary operator before token "("
 #if CURL_AT_LEAST_VERSION(7, 62, 0)
                          ^
plugins/janus_streaming.c:5889:26: error: missing binary operator before token "("
 #if CURL_AT_LEAST_VERSION(7, 62, 0)
                          ^
make[2]: *** [plugins/plugins_libjanus_streaming_la-janus_streaming.lo] Error 1
Makefile:1983: recipe for target 'plugins/plugins_libjanus_streaming_la-janus_streaming.lo' failed
make[2]: Leaving directory '/janus-gateway'

Step to reproduce:

1) git clone https://github.com/kuzm1ch/janus-webrtc-gateway-docker 2) cd janus-webrtc-gateway-docker && docker build .

With flag --disable-plugin-streaming build works.

lminiero commented 4 years ago

Mh I guess you're compiling without libcurl support? I guess I should wrap those checks into an HAVE_LIBRUCL too, which is probably missing.

lminiero commented 4 years ago

The above commit should fix it.

kuzm1ch commented 4 years ago

@lminiero Seems like libcurl is in place.

checking for LIBCURL... yes

I've rechecked with latest master and received the same error.

plugins/janus_streaming.c: In function 'janus_streaming_rtsp_connect_to_server':
plugins/janus_streaming.c:5725:26: error: missing binary operator before token "("
 #if CURL_AT_LEAST_VERSION(7, 62, 0)
                          ^
plugins/janus_streaming.c:5914:26: error: missing binary operator before token "("
 #if CURL_AT_LEAST_VERSION(7, 62, 0)
lminiero commented 4 years ago

Then no idea on what's breaking for you. Maybe your libcurl is extremely old and doesn't have that macro. What's the libcurl version you have installed?

lminiero commented 4 years ago

You can see if this fixes it for you. Try changing this part:

#ifdef HAVE_LIBCURL
#include <curl/curl.h>
#endif

to this:

#ifdef HAVE_LIBCURL
#include <curl/curl.h>
#ifndef CURL_AT_LEAST_VERSION
#define CURL_AT_LEAST_VERSION(x,y,z) 0
#endif
#endif

If the version is so old it doesn't have that macro, it's too old to have the feature we use the check for as well.

kuzm1ch commented 4 years ago

@lminiero lets me share my findings: I have tried mention fixes and this works for me and -->

the version is so old it doesn't have that macro).

The current version of libcurl in image is 7.38. which is the latest stable for debian:jessie https://packages.debian.org/jessie/libcurl4-openssl-dev

Step 32/36 : RUN dpkg -l  | grep libcurl
 ---> Running in 2932dd3c10c1
ii  libcurl3:amd64                     7.38.0-4+deb8u16                 amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:amd64              7.38.0-4+deb8u16                 amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libcurl4-openssl-dev:amd64         7.38.0-4+deb8u16                 amd64        development files and documentation for libcurl (OpenSSL flavour)

After move out to debian:stretch on which latest stable libcurl is 7.52 https://packages.debian.org/stretch/libcurl4-openssl-dev , this problem is resolved.

Thanks.

lminiero commented 4 years ago

Thanks for the feedback and confirming the fix works! I'll add those lines to the code then :+1:

lminiero commented 4 years ago

Added in https://github.com/meetecho/janus-gateway/commit/5aab9f03f57060eb6ba29150f132f248a4f24e0a