I'm a bit confused about how to compile somethingon Centos 5 that's looking for gtk +-2.
./configure errors out with this message:
checking for GTK+ - version >= 2.4.0... no *** Could not run GTK+ test program, checking why... *** The test program failed to compile or link. See the file config.log for the *** exact error that occured. This usually means GTK+ is incorrectly installed. configure: error: Cannot find GTK2
The best information I could find on Google tells me this:
"Edit the script file , it is looking for gtk+-2 while you have gtk2 installed."
That's nice, but how? I edited the "configure" script and changed all references to read gtk2 and that did me no good at all.
How can I address this issue?
Frank Cox wrote:
I'm a bit confused about how to compile somethingon Centos 5 that's looking for gtk +-2.
./configure errors out with this message:
checking for GTK+ - version >= 2.4.0... no *** Could not run GTK+ test program, checking why... *** The test program failed to compile or link. See the file config.log for the *** exact error that occured. This usually means GTK+ is incorrectly
[..]
How can I address this issue?
Look at the config.log you could be missing some packages.
nate
On Sun, 21 Jun 2009 17:59:44 -0700 (PDT) nate wrote:
Look at the config.log you could be missing some packages.
I suspect it's a naming issue, where configure is looking for GTK+-2 but Centos has GTK2.
I posted the error message in my initial query here; this is the relevant section of config.log:
configure:4574: checking for GTK+ - version >= 2.4.0 configure:4719: result: no configure:4752: gcc -o conftest -g -O2 conftest.c -lexpat -lz >&5 conftest.c:16:21: error: gtk/gtk.h: No such file or directory conftest.c: In function 'main': conftest.c:22: error: 'gtk_major_version' undeclared (first use in this function) conftest.c:22: error: (Each undeclared identifier is reported only once conftest.c:22: error: for each function it appears in.) conftest.c:22: error: 'gtk_minor_version' undeclared (first use in this function) conftest.c:22: error: 'gtk_micro_version' undeclared (first use in this function) configure:4758: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "gxmame" | #define PACKAGE_TARNAME "gxmame" | #define PACKAGE_VERSION "0.35beta2" | #define PACKAGE_STRING "gxmame 0.35beta2" | #define PACKAGE_BUGREPORT "" | #define PACKAGE "gxmame" | #define VERSION "0.35beta2" | #define STDC_HEADERS 1 | #define HAVE_STRCHR 1 | #define HAVE_LIBZ 1 | #define HAVE_LIBEXPAT 1 | /* end confdefs.h. */ | | #include <gtk/gtk.h> | #include <stdio.h> | | int | main () | { | return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); | ; | return 0; | } configure:4796: error: Cannot find GTK2
Hi,
On Mon, Jun 22, 2009 at 00:28, Frank Coxtheatre@sasktel.net wrote:
configure:4752: gcc -o conftest -g -O2 conftest.c -lexpat -lz >&5 conftest.c:16:21: error: gtk/gtk.h: No such file or directory
gtk2-devel contains /usr/include/gtk-2.0/gtk/gtk.h. For that to work, you have to use -I/usr/include/gtk-2.0 to the compiler, however that should work automatically by using pkg-config. See the output of this command:
$ pkg-config --cflags gtk+-2.0 -I/usr/include/gtk-2.0 -I/usr/lib64/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/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12
"configure" should be using that automatically, for some reason it does not appear to be doing that correctly... It might be using a string other than "gtk+-2.0" to pass to pkg-config, you could check that...
You could also try to manually override it by passing CFLAGS and LDFLAGS variables to configure using pkg-config to include gtk+-2.0 yourself. That can be done with something like:
$ CFLAGS=`pkg-config --cflags gtk+-2.0` LDFLAGS=`pkg-config --libs gtk+-2.0` ./configure ...
And "./configure --help" might have more details on what else you can do to specify where gtk+ is installed on your system...
HTH, Filipe
On Mon, 22 Jun 2009 01:26:42 -0400 Filipe Brandenburger wrote:
$ pkg-config --cflags gtk+-2.0 -I/usr/include/gtk-2.0 -I/usr/lib64/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/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12
Perhaps we're onto something here. I don't get what you get with that command.
[frankcox@jeff ~]$ pkg-config --cflags gtk+-2.0 Package cairo was not found in the pkg-config search path. Perhaps you should add the directory containing `cairo.pc' to the PKG_CONFIG_PATH environment variable Package 'cairo', required by 'Pango Cairo', not found
[frankcox@jeff ~]$ rpm -qa | grep cairo cairo-1.2.4-5.el5 pycairo-1.2.0-1.1 cairo-devel-1.2.4-5.el5 cairo-1.2.4-5.el5 pycairo-devel-1.2.0-1.1
Hi,
On Mon, Jun 22, 2009 at 01:44, Frank Coxtheatre@sasktel.net wrote:
[frankcox@jeff ~]$ pkg-config --cflags gtk+-2.0 Package cairo was not found in the pkg-config search path. Perhaps you should add the directory containing `cairo.pc'
From previous posts, you seem to have a x86_64 machine and in some
cases you have both i386 and x86_64 versions of the same package installed... I believe your problem might be there.
Before you showed the output of "rpm -q gtk2-devel" and it showed it twice, which indicates you have both i386 and x86_64 versions installed, I believe you should have the x86_64 version only. Try to uninstall the 32-bit version with the "yum erase gtk2-devel.i386" command.
Also, check that the version of "pkgconfig" and "cairo-devel" you have installed are the x86_64 versions. You can do that with this command (and expected output):
$ rpm -q --qf '%{name}-%{version}-%{release}.%{arch}\n' pkgconfig cairo-devel pkgconfig-0.21-2.el5.x86_64 cairo-devel-1.2.4-5.el5.x86_64
That might shed some more light on that issue. Once you get "pkg-config" to work again, try to rerun your ./configure and see if it works now as you expect.
BTW, what exactly are you building? Did you try to see if someone managed to package it as an RPM before? That might help...
HTH, Filipe
On Mon, 22 Jun 2009 02:11:26 -0400 Filipe Brandenburger wrote:
That might shed some more light on that issue. Once you get "pkg-config" to work again, try to rerun your ./configure and see if it works now as you expect.
Problem solved.
[frankcox@jeff ~]$ rpm -q --qf '%{name}-%{version}-%{release}.%{arch}\n' pkgconfig cairo-devel pkgconfig-0.21-2.el5.x86_64 cairo-devel-1.2.4-5.el5.i386
[root@jeff frankcox]# yum install cairo-devel Parsing package install arguments Package cairo-devel-1.2.4-5.el5.i386 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package cairo-devel.x86_64 0:1.2.4-5.el5 set to be updated --> Finished Dependency Resolution Installed: cairo-devel.x86_64 0:1.2.4-5.el5 Complete!
[frankcox@jeff ~]$ pkg-config --cflags gtk+-2.0 Package xproto was not found in the pkg-config search path. Perhaps you should add the directory containing `xproto.pc' to the PKG_CONFIG_PATH environment variable Package 'xproto', required by 'Xrender', not found
[frankcox@jeff ~]$ rpm -q --qf '%{name}-%{version}-%{release}.% {arch}\n' xorg-x11-proto-devel xorg-x11-proto-devel-7.1-9.el5.centos.i386
[root@jeff frankcox]# yum install xorg-x11-proto-devel Parsing package install arguments Package xorg-x11-proto-devel-7.1-9.el5.centos.i386 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package xorg-x11-proto-devel.x86_64 0:7.1-9.el5.centos set to be updated --> Finished Dependency Resolution Installed: xorg-x11-proto-devel.x86_64 0:7.1-9.el5.centos Complete!
[frankcox@jeff ~]$ pkg-config --cflags gtk +-2.0-I/usr/include/gtk-2.0 -I/usr/lib64/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/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12
And after that, the configure worked!
So, the problem was i386-only versions of cairo-devel and xorg-x11-proto-devel that were installed on that machine. How that happened, I have no idea. I just set that machine up a couple of months ago with Centos 5.2/x86_64 and upgraded it to 5.3 shortly after that.
BTW, what exactly are you building?
gxmame-0.35beta2.tar.bz2
Thanks loads for your help! You put me on the right track to getting this working and I appreciate your assistance immensely!
For the other chap who's looking for "commercial support" for Centos, here is a lovely example of how Centos support really works.
On Sun, Jun 21, 2009 at 18:02, Frank Coxtheatre@sasktel.net wrote:
./configure errors out with this message: checking for GTK+ - version >= 2.4.0... no
Do you have the "gtk2-devel" package installed? You need it to build something that uses GTK+ 2.10...
HTH, Filipe
On Sun, 21 Jun 2009 21:37:14 -0400 Filipe Brandenburger wrote:
On Sun, Jun 21, 2009 at 18:02, Frank Coxtheatre@sasktel.net wrote:
./configure errors out with this message: checking for GTK+ - version >= 2.4.0... no
Do you have the "gtk2-devel" package installed? You need it to build something that uses GTK+ 2.10...
[frankcox@jeff ~]$ rpm -q gtk2-devel gtk2-devel-2.10.4-20.el5 gtk2-devel-2.10.4-20.el5