[MPlayer-dev-eng] Gui #include correction

Adam Tlałka atlka at pg.gda.pl
Mon May 15 11:41:48 CEST 2006


On Sat, May 13, 2006 at 10:48:51PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> On Saturday, 13 May 2006 at 22:02, Adam Tlałka wrote:
> > On Sat, May 13, 2006 at 07:21:03PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> > > On Saturday, 13 May 2006 at 18:08, Diego Biurrun wrote:
> > > > On Sat, May 13, 2006 at 04:59:32PM +0200, Adam Tla?ka wrote:
> > > > > On Sat, May 13, 2006 at 03:45:52PM +0200, Diego Biurrun wrote:
> > > > > > On Sat, May 13, 2006 at 10:05:15AM +0200, Adam Tla?ka wrote:
> > > > > > > 
> > > > > > > since gtk code is located in Gui/mplayer/gtk now include paths leading
> > > > > > > to main dir should be corrected. Patch attached.
> > > > > > 
> > > > > > This is not necessary since we have -I.. in the CFLAGS.  Patch rejected.
> > > > > 
> > > > > Really? Funny ;), I have current cvs version and it just not compile with gui
> > > > > enabled after configure. It reports about undefined messages while
> > > > > parsing gui code.
> > > > > So what is wrong here?
> > > > 
> > > > This is a detail you should mention from the start.  It works without
> > > > problems for me and I haven't heard any reports about the GUI not
> > > > compiling before.  I don't believe the problem is in the build system.
> > > 
> > 
> > OK I've checked it again:
> > 
> > $ cvs update -d .
> 
> Try cvs update -dPA

No change anyway.

> 
> > $ ../config.sh
> > $ make
> > .
> > .
> > .
> > cc -c -I../libvo -I../../libvo  -fno-PIC -O4 -march=pentium4
> > -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT
> > -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I. -I.. -I../loader -I./wm
> > -I./skin -I/usr/include/freetype2 -I/usr/include/gtk-2.0
> > -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo
> > -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
> > -I/usr/lib/glib-2.0/include     -DDEBUG  -o mplayer/gtk/menu.o
> > mplayer/gtk/menu.c
> > mplayer/gtk/menu.c: In function `create_PopUpMenu':
> > mplayer/gtk/menu.c:403: error: `MSGTR_MENU_AboutMPlayer' undeclared
> > (first use in this function)
> > mplayer/gtk/menu.c:403: error: (Each undeclared identifier is reported
> > only oncemplayer/gtk/menu.c:403: error: for each function it appears
> > in.)
> > mplayer/gtk/menu.c:403: error: parse error before string constant
> > mplayer/gtk/menu.c:405: error: `MSGTR_MENU_Open' undeclared (first use
> > in this function)
> > etc.
> > 
> > config.sh:
> > # !/bin/bash
> 
> > ./configure --enable-menu --enable-gui --enable-largefiles
> --disable-inet6 --disable-arts --disable-esd --disable-nas --disable-gl
> --disable-vesa --disable-svga --disable-sdl --disable-fbdev $*
> 
> > My distro is Ubuntu stable, gcc 3.4.5, make 3.80.
> > As you can see there is -I.. in compilation command.
> > Maybe my compiler treats #include "../something.h" relatively to the
> > source file dir and not uses -I paths in case of path specified in
> > #include (relative or absolute). So maybe there should be -I../../..
> > in compilation command and just #include "something.h" in source?
> 
> My guess is your cvs checkout is somehow broken. Works fine here.

I've tested it a bit and it seams that it is some make problem.
Lets's have a look - mplayer cvs is in mplayer_cvs dir.

As you can see compilation of gui part starts from Gui dir so:

-I.   points to  mplayer_dist/Gui
-I..  points to  mplayer_dist

source is taken from mplayer_dist/Gui/mplayer/gtk/menu.c

so #include "../../config.h" for example searches for

mplayer_dist/Gui/../../config.h -> mplayer_dist/../config.h
mplayer_dist/../../config.h
mplayer_dist/Gui/mplayer/gtk/../../config.h -> mplayer_dist/Gui/config.h

config.h is in mplayer_dist dir and can't be found this way :(

I'am not sure what is going on here. Maybe my make is starting
compilation command (cc ...) in different dir so relative -I directives
points to different directories then on other systems/distros.
Because mplayer_dist is in -I.. so it's enough to just #include
"config.h"
to get it working correctly. But in case of different working dir
of cc command it could lead to errors.

So patching source and using #include "../../../config.h" will work
always properly. Other solution is using non-realtive path in -I
directives.

Generally it looks like using relative path in -I directives could lead
to problems IMHO.

Regards
-- 
Adam Tlałka       mailto:atlka at pg.gda.pl    ^v^ ^v^ ^v^
PGP public key:   finger atlka at sunrise.pg.gda.pl




More information about the MPlayer-dev-eng mailing list