DoubangoTelecom/doubango

INT_MAX undeclared

bsnw opened this issue · 2 comments

bsnw commented

I am following the document from:
https://www.doubango.org/conf-call/technical-guide.pdf?svn=1

In section:
4.2.18

When compiling the doubango I get an error:
"src/video/tdav_session_video.c:1505:49: error: 'INT_MAX' undeclared (first use in this function)
if (bw_up_ref_kbps < 0 || bw_up_ref_kbps == INT_MAX)" .

The document is not current and I may have done something wrong when troubleshooting when given commands failed. I was able to get all previous steps to work but I can not get this one to go. Hoping you might be able to help as this looks like a very nice application.

Here is the error in whole.
make[2]: Entering directory /opt/doubango/tinyDAV' /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../tinySAK/src -I../tinyNET/src -I../tinyIPSec/src -I../tinySDP/include -I../tinyBFCP/include -I../tinyRTP/include -I../tinyMEDIA/include -I../tinyMSRP/include -Iinclude -g -O2 -O3 -DNDEBUG -g -O2 -O3 -DNDEBUG -MT src/video/libtinyDAV_la-tdav_session_video.lo -MD -MP -MF src/video/.deps/libtinyDAV_la-tdav_session_video.Tpo -c -o src/video/libtinyDAV_la-tdav_session_video.lotest -f 'src/video/tdav_session_video.c' || echo './'src/video/tdav_session_video.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../tinySAK/src -I../tinyNET/src -I../tinyIPSec/src -I../tinySDP/include -I../tinyBFCP/include -I../tinyRTP/include -I../tinyMEDIA/include -I../tinyMSRP/include -Iinclude -g -O2 -O3 -DNDEBUG -g -O2 -O3 -DNDEBUG -MT src/video/libtinyDAV_la-tdav_session_video.lo -MD -MP -MF src/video/.deps/libtinyDAV_la-tdav_session_video.Tpo -c src/video/tdav_session_video.c -fPIC -DPIC -o src/video/.libs/libtinyDAV_la-tdav_session_video.o src/video/tdav_session_video.c: In function '_tdav_session_video_timer_cb': src/video/tdav_session_video.c:1505:49: error: 'INT_MAX' undeclared (first use in this function) if (bw_up_ref_kbps < 0 || bw_up_ref_kbps == INT_MAX) { ^ src/video/tdav_session_video.c:1505:49: note: each undeclared identifier is reported only once for each function it appears in src/video/tdav_session_video.c: In function '_tdav_session_video_report_bw_usage_and_jcng': src/video/tdav_session_video.c:1696:71: error: 'INT_MAX' undeclared (first use in this function) ret = trtp_manager_set_app_bw_and_jcng(base->rtp_manager, INT_MAX/* unused */, (int32_t)session->qos_metrics.bw_down_est_kbps, jcng_q); ^ make[2]: *** [src/video/libtinyDAV_la-tdav_session_video.lo] Error 1 make[2]: Leaving directory/opt/doubango/tinyDAV'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/doubango'
make: *** [all] Error 2

The quickfix is to just open the file and add
#include <limits.h>

which will declare and define the INT_MAX limit they're reffering to.