Loggytronic Forum

VOMP => VOMP General / MVP => Topic started by: TEDDYXXL on November 25, 2011, 19:22:24

Title: Compile vompserver fails
Post by: TEDDYXXL on November 25, 2011, 19:22:24
Hi !

After installling openSUSE 12.1 compile of vompserver-plugin fails:

Plugin vompserver:
make[1]: Entering directory `/backup/privat/tv/dvb/vdr-1.7.21/PLUGINS/src/vompserver-0.3.1-3-Yaris'
( if [ -f .standalone ] ; then ( rm -f .standalone; make clean ; make objects ) ; else exit 0 ;fi )
g++ -g -O3 -Wall -Woverloaded-virtual -Wno-parentheses -fPIC -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"vompserver"' -DVOMPSERVER -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -I../../../include -I/include -o mediafile.o mediafile.c
mediafile.c: In member function 'virtual MediaList* MediaFile::getMediaList(const MediaURI*)':
mediafile.c:126:21: error: expected primary-expression before 'struct'
mediafile.c:126:36: error: 'd_name' was not declared in this scope
mediafile.c:126:42: error: 'offsetof' was not declared in this scope
mediafile.c:126:58: error: array bound is not an integer constant before ']' token
make[1]: *** [mediafile.o] Error 1
make[1]: Leaving directory `/backup/privat/tv/dvb/vdr-1.7.21/PLUGINS/src/vompserver-0.3.1-3-Yaris'

Any ideas ?

Dirk
Title: Re: Compile vompserver fails
Post by: odin4242 on November 27, 2011, 07:59:56
Hi Teddyxxl,

i ran into the same problem. Just commented out all code and return null instead. Compiles now like a charm, but it would be great if someone can realy fix this

Odin4242
Title: Re: Compile vompserver fails
Post by: 4ndreas on December 21, 2011, 18:39:20
Hi,
are there any news on this topic?

I commented out the faulty line (thanx odin4242) and it compiles but I think there was some intended use for this line :-)

Regards,
Andreas
Title: Re: Compile vompserver fails
Post by: davep on December 21, 2011, 21:30:29
The vompserver plugin compiles fine for me (GCC 4 4 3) and I can't see any changes in later versions which could cause it to fail.

Do you mean that you just commented out the line:
    char b[offsetof(struct dirent, d_name) + NAME_MAX + 1];

That section of code was copied from the GNU C Library Reference Manual (2007) and is intended to make sure that the memory allocated to a dirent structure is always guaranteed to be large enough. I'm no expert but I don't think there is a problem on Linux, and even if there were, it would only be an issue if you had very large filenames (close to 255 characters).

Dave
Title: Re: Compile vompserver fails
Post by: 4ndreas on December 22, 2011, 17:37:16
Hi Dave,
yes, that's the line we commented out. I don't know anything about programming, so I can't comment your explanation. Do you mean we don't really need this line if filenames are less than 255 characters? I can live with that...
The gcc on my system (openSuSE 12.1) is 4.6.2.

Regards,
Andreas
Title: Re: Compile vompserver fails
Post by: riban on August 18, 2012, 16:58:15
This still fails to compile with gcc V4.6.3, i.e. on Ubuntu 12.04. Commenting out the error allows the server to compile but we should figure out whether that line is needed and whether simply commenting out may cause undesired effects.
My vdr host blew up this morning and so I have been building a new one and this is one of the many issues I am having to resolve, having moved to the current version of vdr (1.7,22) running on the current LTS of Ubuntu (12.04).
Title: Re: Compile vompserver fails
Post by: MartenR on August 19, 2012, 09:20:22
Please add
#include <stdio.h>
#include <stddef.h>

as includes.
Title: Re: Compile vompserver fails
Post by: riban on August 27, 2012, 07:47:30
I confirm that adding:

#include <stddef.h>

to mediafile.c fixes this issue.

Note: <stdio.h> is not required to fix this issue.