Author Topic: Compile vompserver fails  (Read 7109 times)

Offline TEDDYXXL

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
    • Email
Compile vompserver fails
« 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

Offline odin4242

  • Full Member
  • ***
  • Posts: 31
    • MSN Messenger - passport@till-groos.de
    • View Profile
Re: Compile vompserver fails
« Reply #1 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
M3N78-VM | 64GB SSD + 2TB WD Green | NetCeiver 2xDVB-S2-Dual 1xDVB-S Dual | SoftHDDevice
LG 37" Full-HD per HDMI
MediaMVPs | WinVDRStreamer | SMT 7020s | Raspberry Pi
easyVDR 1.0

Offline 4ndreas

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Compile vompserver fails
« Reply #2 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

Offline davep

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: Compile vompserver fails
« Reply #3 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:
Code: [Select]
    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

Offline 4ndreas

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Compile vompserver fails
« Reply #4 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

Offline riban

  • Full Member
  • ***
  • Posts: 35
    • View Profile
Re: Compile vompserver fails
« Reply #5 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).

Offline MartenR

  • Hero Member
  • *****
  • Posts: 789
    • View Profile
Re: Compile vompserver fails
« Reply #6 on: August 19, 2012, 09:20:22 »
Please add
#include <stdio.h>
#include <stddef.h>

as includes.

Offline riban

  • Full Member
  • ***
  • Posts: 35
    • View Profile
Re: Compile vompserver fails
« Reply #7 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.