[MPlayer-dev-eng] Switch to gtk2.0

Gábor Lénárt lgb at lgb.hu
Fri Jul 30 10:32:00 CEST 2004


On Fri, Jul 30, 2004 at 01:18:11AM +0200, Gianluigi Tiesi wrote:
> I've compiled succesfully mplayer using gtk2, the only glitch is define:
> #define GTK_ENABLE_BROKEN
> on top of main/Gui/mplayer/gtk/about.c
> (it can be avoided using the new GtkText)
> I think this can make mplayer gui compile also on win32 and can avoid
> linking both glib1.2 and glib2.0 (due to other libs dependancies)

lgb at vega $ gtk-config --libs
-L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm
lgb at vega $ gtk-config --cflags
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include
lgb at vega $ gtk-config --version
1.2.10

Recommended method for GTK2 and above:

lgb at vega $ pkg-config --libs gtk+-2.0
-Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
lgb at vega $ pkg-config --cflags gtk+-2.0 
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
lgb at vega adsl $ pkg-config --modversion gtk+-2.0
2.4.1

But surprise:

lgb at vega main $ pkg-config --cflags gtk+
-I/usr/include/gtk-1.2 -I/usr/X11R6/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include
lgb at vega main $ pkg-config --libs gtk+
-L/usr/X11R6/lib -lgtk -lgdk -lXi -lXext -lX11 -lm -lglib
lgb at vega adsl $ pkg-config --modversion gtk+
1.2.10

So, pkg-config can be used for GTK1.2 too, well, at least on Gentoo and
Debian ;-)
[if it's installed anyway. and it seems call gtk-config too for GTK1.2
 but I'm totally unfamiliar with pkg-config internals]
However this may not true for every distros etc ...

And as for main/Gui/mplayer/gtk/about.c there can be that #define
if GTK version is >2, with possible a warning, that it should be fixed.

Also checking and using GTK2 may not be enabled by default but only
a configure option (at least right now).

- Gábor (larta'H)




More information about the MPlayer-dev-eng mailing list