Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GNOME gtk

Status
Not open for further replies.

Squadcar7

IS-IT--Management
Mar 27, 2002
25
US
This is starting to bother me. Everytime I download an app that has anything to do with gtk, it fails. I think I've only dealt with Makefiles that do the standard ./configure, make, make install, and everytime I run ./configure, I get a message to the effect of...

...lots of conf stuff that works fine...
checking for gtk-config... no
checking for GTK - version >= 1.2.0... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the full path to gtk-config.
configure: error: Cannot find GTK: Is gtk-config in path?

Well, now I pull my hair out. Not about to give up on Linux and go back to Winblows though. Gonna figure out how this works. Then I do this, thinkin' make I'll try and do a ./configure PREFIX=x 'x being the path to GTK.
I remembered the whereis command from when I started makin' web pages and I was learnin' perl. So I do the following with my thoughts between the commands...
# whereis gtk
gtk: /etc/gtk /usr/lib/gtk
Well darnit, neither one of those directories has a /bin folder. Now what do I do? Wait.
# cd /home/myusername/inbox/foldertarbalcreated
# ./configure PREFIX=/etc/gtk
Same error? Darn, let's try this...
# ./configure PREFIX=/usr/lib/gtk
Argh, still not workin'. Let's go to Tek-tips and see if someone can help me...
So here I am, with a little less energy than when I started. I'm using Mandrake 8.1 running GNOME. I know this is probably something easy, but I don't know how to find and change environment variables, or that would have been my next step. As soon as I get this all figured out, I'm probably gonna have to rebuild because I've got tons of apps that are just sitting in my inbox waiting to be installed and used, but can't install because of this error. HELP?
 
The error message says it's looking for the gtk-config script. Using the prefix option to configure will not help with this. You need to find that script. Something like
find / -name 'gtk-config'
will do the trick. I'm guessing you probably don't have the GTK development packages installed. The files in /usr/lib/gtk are probably the runtimes, which allow you to run GTK apps, but not build them. If you find gtk-config, make sure it's in your path and that you can execute it. If you can't find it, then you should probably break out the install CDs and install the GTK development RPMs.
 
Ok...so I've got that done from the cds. Took me a while because Mandrake likes to put lib in front of all the standard named packages. I had to install XFee86-devel and Glib-Devel, but I got the GTK+-Devel installed. Now my installation gets a little further and I get another wierd message. Here it is...

*** Could not run GTK test program, checking why...
*** The test program failed to compile or link. See config.log for the
*** exact error that occurred. This usually means GTK was incorrectly installed
*** or you have moved GTK since it was installed. In the latter case, you
*** may want to edit gtk-config script: /usr/bin/gtk-config
config: error: Cannot find GTK. Is gtk-config in path?

Not quite sure what this one means, but I'm sure AdaHacker's laughin' pretty hard at my stupidity...Any help would be obliged. All config.log shows me is a bunch of what looks like C language, and I only know enough about C to know what it sort of looks like...learnin' though.
 
Don't worry, I wouldn't laugh at you for something like this. A bad library installation can bea tricky thing to fix, especially if you're inexperienced.
Let's start from the beginning. First thing to do is make sure the GTK libraries and header files are installed. To do this, we'll use the 'locate' command. Note that locate uses a database to find things, so if it doesn't give you any output, try running updatedb to update the database. Be warned that updating the database takes a while. After that, we need to check the permissions on the libraries and header files. Then, we can find and run gtk-config to see if it's giving the right information.

Start by running
locate gtk-1.2
This should print out a list of .h files and a few .so files. Note the directories those files are in. Make sure you have read permissions on everything in those directories.
Next, run
which gtk-config
This should print the path to gtk-config. If it doesn't, find it with
locate gtk-config
and add it to your path. Once gtk-config is in your path, run
gtk-config --libs ; gtk-config --cflags
This will print a list of parameters to gcc indicating the paths to the GTK libraries and header files. Make sure that these include the gtk-1.2 directories you found earlier.

If all this doesn't yeild anything useful, you may have to just go through config.log. You don't have to understand any C, just find somehting that looks like an error message and see if you can make any sense out of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top