LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-01-2006, 01:09 AM   #1
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 13.37
Posts: 252

Rep: Reputation: 32
configure problem, says need GTK-2 but installed


Hi all. I think this is an appropriate place to post this if not accept my appologies and point me in the right direction.

I am trying to configure a openq-0.3.2tgz, a QQ messaging plugin for Gaim, and I am getting the following error.

checking for pkg-config... (cached) /usr/bin/pkg-config
checking for GTK+ - version >= 2.0.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:
*** GTK+ 2.0 is required to build OpenQ; please make sure you have the
*** GTK+ development headers installed. The latest version of GTK+ is always
*** available at http://www.gtk.org/.

Howwever I have these GTK packages installed...

gtk+-1.2.10-i386-3
gtk+2-2.8.20-i486-1
libgtkhtml-2.6.3-i486-1

The GTK files are installed to....

/usr/include/gtk-2.0/gtk/

The config.log shows.....

configure:12078: checking for GTK+ - version >= 2.0.0
configure:12224: result: no
configure:12258: gcc -o conftest -g -O2 -Wall -g3 conftest.c >&5
configure:12310:21: gtk/gtk.h: No such file or directory
configure: In function `main':
configure:12316: error: `gtk_major_version' undeclared (first use in this function)
configure:12316: error: (Each undeclared identifier is reported only once
configure:12316: error: for each function it appears in.)
configure:12316: error: `gtk_minor_version' undeclared (first use in this function)
configure:12316: error: `gtk_micro_version' undeclared (first use in this function)
configure:12261: $? = 1
configure: failed program was:
| #line 12238 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME "openq"
| #define PACKAGE_TARNAME "openq"
| #define PACKAGE_VERSION "0.3.2"
| #define PACKAGE_STRING "openq 0.3.2"
| #define PACKAGE_BUGREPORT "http://openq.sourceforge.net/"
| #define PACKAGE "openq"
| #define VERSION "0.3.2"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_STDLIB_H 1

What is the confdefs.h?? It is not on my system. Important??

My sytem....
Slackware 11.0
kernel 2.4.33.3
gcc version 3.4.6
glib-1.2.10
glib2-2.10.3
glibc-2.3.6

Any help would be much appreciated.

Thanks for your time, BashTin.
 
Old 12-01-2006, 01:36 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,000
Blog Entries: 11

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
The problem here is with the ./configure script. Instead of using
the 'gtk-config --cflags' the owner of the script has hard-coded the
path to the includes.

Have a look whether it (the script) lets you set the paths explicitly,
and if so, point it at the gtk.h file you have installed.


Cheers,
Tink
 
Old 12-01-2006, 01:53 AM   #3
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
im on the same distro as you (default slackware install, everything but kdei installed from cd1 and cd2) and it finds gtk for me. id like to see the solution.
 
Old 12-01-2006, 02:39 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,772

Rep: Reputation: 478Reputation: 478Reputation: 478Reputation: 478Reputation: 478
Sometimes you can work around this problem by disabling the gtk test compile during confguration (usually with --disable-gtktest)
 
Old 12-01-2006, 04:46 AM   #5
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 13.37
Posts: 252

Original Poster
Rep: Reputation: 32
Thanks for the replies guys. I did try the '--disable--gtktest' but somehow it seems to have ignored my explicit request, done it and then spat out the same result.

Tinkster. Yes what you say makes sense but I am a little out of my depth here.
gtk.h is located at /usr/include/gtk-2.0/gtk.

I tried running the configure script with './configure CPPLFLAGS=/usr/include/gtk-2.0/gtk' and
/configure LDFLAGS=/usr/include/gtk-2.0/gtk'
same result.

I ran 'gtk-config --libs --cflags' just to get some information that may help and got.....
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include
-L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm

./configure --help does not list anything about GTK_LIBS.

Anymore ideas??

BashTin
 
Old 12-01-2006, 09:16 AM   #6
ZeromusM
LQ Newbie
 
Registered: May 2006
Distribution: OpenSUSE 10.0
Posts: 27

Rep: Reputation: 15
Quote:
I tried running the configure script with './configure CPPLFLAGS=/usr/include/gtk-2.0/gtk' and /configure LDFLAGS=/usr/include/gtk-2.0/gtk' same result.
Try looking at ./configure --help and see what switch they use to pass CPPFLAGS and LDFLAGS on the command line, if any, because I'm fairly certain the way you wrote it there, it would just be ignored by the script. If it's a really bad script, they might not provide a way to pass CPPFLAGS and LDFLAGS, in which case you might have to search through the script for this gtk/gtk.h and replace it with the proper path.
 
Old 12-01-2006, 09:58 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,772

Rep: Reputation: 478Reputation: 478Reputation: 478Reputation: 478Reputation: 478
Usually GTK2 programs use this instead of gtk-config:
pkg-config --cflags gtk-2.0

Sometimes you have to hack things a bit...
 
Old 12-01-2006, 11:58 AM   #8
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 13.37
Posts: 252

Original Poster
Rep: Reputation: 32
Thanks guys but like I said I am not to clued up on this but am willing to put the time in and try to learn something.

gnashly where would I try to use this 'pkg-config --cflags gtk-2.0'? In the configure code or pass as an arguement to configure? If so how?

ZeromusM this is what --help says so I passed CPPLFLAGS=/usr/include/gtk-2.0/gtk' and /configure LDFLAGS=/usr/include/gtk-2.0/gtk'. Wrong or right?
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.

OK I know I am pushing it a bit now but here is what I believe is the pertanent part of the code. Could someone TELL me PLEASE what/where I should change.

THANKS FOR ALL YOUR HELP, BASHTIN.
(Oh I tried the --disable-gtktest and it still failed!!

********************************************************************

Check whether --enable-gtktest or --disable-gtktest was given.
if test "${enable_gtktest+set}" = set; then
enableval="$enable_gtktest"

else
enable_gtktest=yes
fi;

pkg_config_args=gtk+-2.0
for module in .
do
case "$module" in
gthread)
pkg_config_args="$pkg_config_args gthread-2.0"
;;
esac
done

no_gtk=""

# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done

test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG

if test -n "$PKG_CONFIG"; then
echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
echo "${ECHO_T}$PKG_CONFIG" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi


if test x$PKG_CONFIG != xno ; then
if pkg-config --atleast-pkgconfig-version 0.7 ; then
:
else
echo *** pkg-config too old; version 0.7 or better required.
no_gtk=yes
PKG_CONFIG=no
fi
else
no_gtk=yes
fi

min_gtk_version=2.0.0
echo "$as_me:$LINENO: checking for GTK+ - version >= $min_gtk_version" >&5
echo $ECHO_N "checking for GTK+ - version >= $min_gtk_version... $ECHO_C" >&6

if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
if $PKG_CONFIG --uninstalled $pkg_config_args; then
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
enable_gtktest=no
fi

if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
:
else
no_gtk=yes
fi
fi

if test x"$no_gtk" = x ; then
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
if test "x$enable_gtktest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS"
rm -f conf.gtktest
if test "$cross_compiling" = yes; then
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */

#include </usr/include/gtk-2.0/gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>

int
main ()
{
int major, minor, micro;
char *tmp_version;

system ("touch conf.gtktest");

/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version");
exit(1);
}

if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) ||
(gtk_micro_version != $gtk_config_micro_version))
{
printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
printf("*** to point to the correct configuration files\n");
}
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))
{
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
}
else
{
if ((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
no_gtk=yes
fi
rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gtk" = x ; then
echo "$as_me:$LINENO: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5
echo "${ECHO_T}yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6
:
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
if test "$PKG_CONFIG" = "no" ; then
echo "*** A new enough version of pkg-config was not found."
echo "*** See http://pkgconfig.sourceforge.net"
else
if test -f conf.gtktest ; then
:
else
echo "*** Could not run GTK+ test program, checking why..."
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */

#include </usr/include/gtk-2.0/gtk/gtk.h>
#include <stdio.h>

int
main ()
{
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GTK_CFLAGS=""
GTK_LIBS=""
{ { echo "$as_me:$LINENO: error:
*** GTK+ 2.0 is required to build OpenQ; please make sure you have the
*** GTK+ development headers installed. The latest version of GTK+ is always
*** available at http://www.gtk.org/." >&5
echo "$as_me: error:
*** GTK+ 2.0 is required to build OpenQ; please make sure you have the
*** GTK+ development headers installed. The latest version of GTK+ is always
*** available at http://www.gtk.org/." >&2;}
{ (exit 1); exit 1; }; }
fi


rm -f conf.gtktest
 
Old 12-01-2006, 01:49 PM   #9
ZeromusM
LQ Newbie
 
Registered: May 2006
Distribution: OpenSUSE 10.0
Posts: 27

Rep: Reputation: 15
Quote:
*** GTK+ 2.0 is required to build OpenQ; please make sure you have the
*** GTK+ development headers installed.
I saw this after rereading your original post. Do you have the gtk2-devel package installed?

Edit: And you were right, that was the correct way to pass CPPFLAGS on the command line with this configure script.

Last edited by ZeromusM; 12-01-2006 at 01:51 PM.
 
Old 12-01-2006, 01:53 PM   #10
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
i have the same 3 gtk packages he stated in the original post as well. ive looked myself and cant find any packages with 'devel' in it, they must be included in one of the 3 mentioned. with my setup i can ./configure this program fine.. im just on the default install of the same distro as he is.
do you need to run 'ldconfig'?
 
Old 12-01-2006, 08:33 PM   #11
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 13.37
Posts: 252

Original Poster
Rep: Reputation: 32
nadroj. You mean you have compiled this plugin ok on your Slackware? Oh just tried running ldconfig, same result.

ZeromusM like nodroj says above I cannot find any package called gtk-2*dev* or anything like it either and the headers are on my system so I can only presume (dangerous I know) that what is required is there.

Ok will keep working on it.

Thanks again for all the input guys and dont stop the ideas coming if you have anymore!

BashTin
 
Old 12-01-2006, 09:39 PM   #12
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
yes i am able to run the ./configure script for the package your talking about. think about the software you have installed or removed since you setup slackware on your machine. also during the initial installation of the OS what options did you choose? i chose basic full install (everything selected and installed from cd1 and cd2 except kdei).

search around here or other linux-oriented sites for this, as it seems to be a common problem (not just for gtk2 but also others). theres also mention about using pkg-config to fix this, if you havent already give those suggestions a shot.

not sure where im going with this but run this command to see if the outputs are similar:
Code:
jordan@darkstar:~$ slocate *.pc | grep -i gtk
/usr/lib/pkgconfig/gtk+-2.0.pc
/usr/lib/pkgconfig/libgtkhtml-2.0.pc
/usr/lib/pkgconfig/gtk-doc.pc
/usr/lib/pkgconfig/mozilla-gtkmozembed.pc
/usr/lib/pkgconfig/gtk+.pc
/usr/lib/pkgconfig/gtk+-x11-2.0.pc
/usr/lib/pkgconfig/seamonkey-gtkmozembed.pc
you may or may not have to run it as root. also you will have to run updatedb if you havent used slocate before.
 
Old 12-02-2006, 04:59 AM   #13
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 13.37
Posts: 252

Original Poster
Rep: Reputation: 32
Thanks nardroj.
Tried that and have the same packages as you.

Seem to be a little closer now. I took out the c program out of the code above and tried to compile it independantly as I think this is where the script is failing because it complains about cannot find gtk.h

I checked my paths and they sparse and/or empty. After setting them, exporting them & runnig ldconfig I got it to compile, now found all the headers, but with zillions of errors/warnings.

Before I go futher perhaps you could tell me what these enviroment variables are set to on your system and do you have any idea why they were not set on mine in installation?

CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
LIBARY_PATH

Will get this working if it kills me!!

BashTin
 
Old 12-02-2006, 11:11 AM   #14
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
all of them returned nothing except CPLUS_INCLUDE_PATH, which was: /usr/lib/qt/include:/usr/lib/qt/include

i have no clue why it doesnt work for you. the only thing i can think of is if you didnt do a complete install or if youve removed programs you shouldnt have, or maybe install programs from source previously. i havent removed any programs from the full install (except of course the initiall non-installed kdei), and have installed 2 programs so far using installpkg.

did the slocate command bring back all the same files?
 
Old 12-03-2006, 01:14 AM   #15
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Ok, skipping the gtk test by pulling out the test program is not going to help. The package requires gtk+ version 2. So, the configure script includes a simple program (the one you're trying to pull out) to verify that a program using gtk+ can compile. That's because the actual program itself will use gtk+ in much (if not identically) the same way. Assuming you rip out the test program, the actual package itself will fail to compile in exactly the same way the test program failed (or won't compile gtk+ support in at all - i.e. no window/visual component to the program).

About the GTK package... First thing to realize: gtk+ version 1.X and gtk+ version 2.X are not even remotely interchangeable. As I understand it, version 2 was a virtually complete rewrite. Thus, nothing from gtk+ version 1 will be of any use to you if the package requires gtk+ version 2. You can have both versions of gtk+ installed on the same system without problems; they are completely separate.

Ok, quick crash course in compiling programs. When you see this:
Code:
#include <gtk/gtk.h>
it's telling the compiler to find the file "gtk.h" located in a directory named "gtk". Simple enough, but where does it look for the gtk directory? It looks in standard "system" include locations such as: /usr/include and /usr/local/include. If the gtk subdirectory is not found in one of those "system" include locations, the compiler needs to be told where else to look. Enter the pkg-config tool...

In the slocate output that nadroj provided, there are a number of files with a "pc" extension. Those files contain information the pkg-config tool uses to record where, on your particular system, a packages development files are located. This information can be retrieved by running the pkg-config tool. For instance, on my system:
Code:
$ pkg-config --cflags gtk+-2.0
-DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/X11R6/include
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/freetype2/config
-I/usr/include/glib-2.0 -I/usr/include/glib-2.0/include
The results on your system will probably vary, but take note of the sequence of "-I" arguments. Each on of those adds another "system" include location to search for files incorporated in a program; think of it as an equivalent of your PATH environment variable - adding another location to look for a matching executable. The text in blue indicates where the file resides on my system. In particular: /usr/include/gtk-2.0/gtk/gtk.h

The configure script should run the pkg-config command to get the arguments it needs to compile the package automatically.

If you run pkg-config as shown above and get an error, or you cannot find the gtk/gtk.h file in any of the directories listed with a preceding "-I" then that's your problem. You likely have a corrupt gtk-2.0 installation (or it's not installed to begin with). And hence, that's why the configure script fails: it either gets no arguments from pkg-config or it gets the incorrect arguments.

Post the results of the pkg-config command I provided above, and we'll go to the next step.

Last edited by Dark_Helmet; 12-03-2006 at 01:21 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
./configure and GTK+-2.0 exvor Linux - Software 2 05-02-2006 02:51 PM
Problem with ./configure; cannot find gtk-config audiorevolution Linux - Software 8 05-21-2005 03:37 AM
help with ./configure of gtk+2.4.9 minm Linux - Newbie 4 11-09-2004 08:56 AM
GTK installed, yet ./configure can't find it Micro420 Mandriva 12 08-13-2004 05:27 AM
can't configure GTK!-gtk-gnutella ogkyusa Linux - Software 2 08-09-2003 05:38 PM


All times are GMT -5. The time now is 05:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration