bplaum / gmerlin-avdecoder

Gmerlin audio/video decoder library
GNU General Public License v2.0
0 stars 1 forks source link

FTBFS due to missing includes #11

Closed umlaeute closed 1 week ago

umlaeute commented 4 months ago

currently the Debian package of gmerlin-avdecoder fails to build from source, because it uses symbols like atoi() but does not properly include the relevant headers (stdlib.h).

Older compilers were rather lax about missing declarations and you would get away with an implicit declaration, but since gcc-13 (or so) the default is to error out.

the following patch fixes the problem for me:

Index: gmerlin-avdecoder-2.0.0~svn6298~dfsg0/plugins/options.c
===================================================================
--- gmerlin-avdecoder-2.0.0~svn6298~dfsg0.orig/plugins/options.c
+++ gmerlin-avdecoder-2.0.0~svn6298~dfsg0/plugins/options.c
@@ -25,6 +25,8 @@
 #include <avdec.h>
 #include "options.h"

+#include <stdlib.h>
+
 void
 bg_avdec_option_set_parameter(bgav_options_t * opt, const char * name,
                               const gavl_value_t * val)

As the observant reader will notice, this patch is against the svn6298 version of gmerlin-avdecoder (a snapshot from the days when gmerlin and friends were still hosted on SourceForge)... which is rather aged.

However, a quick inspection shows that the file still uses atoi() without including stdlib.h, so I thought I'd report it nevertheless.

I haven't tried to actually build the current main branch to see whether the problem persists.

(a new release would be very welcome :wink: )

This is related to https://github.com/bplaum/gmerlin/issues/10

bplaum commented 1 week ago

I fixed options.c (wondering why I didn't even get a warning). Please open a new issue if there are similar bugs left.