954,242 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

installing GTK+ on Ubuntu

I posted this in the C++ forum, apparently this is a better place... I need to install GTK+ on Linux, but since im obviously still a complete ignorant fool when it comes to linux (have never used it before) I need help. I dont understand how to install all of the tools that it requires. Can anyone help me to set these things up? I tried to follow the instructions for installation but it didn't help. I keep getting an error with $ make install saying that i dont have permission to access /usr/local for some reason. I just have no clue on this...

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

you need to run it as root use the sudo -i then login as root
then run the ./configure command and then the make install command
but you need to be logged in as root or belong to a group that has access to that directory

HITMANOF44th
Posting Whiz in Training
283 posts since Apr 2009
Reputation Points: 24
Solved Threads: 33
 

well that fixed that problem but ive run into a whole host of new problems... thanks anyways

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

Don't get discouraged, it all starts to make sense with a little time. :)

Beastmanh
Junior Poster in Training
56 posts since Jan 2008
Reputation Points: 48
Solved Threads: 4
 

Is there any reason you can't use the package manager (Synaptic in this case) to install it? It will resolve all of the dependencies for you.

Stinomus
Junior Poster
110 posts since May 2009
Reputation Points: 58
Solved Threads: 17
 

I wanted to do that, seeing as it would be simpler by leaps and bounds, but alas i cant seem to find it in a package! I searched all of the GTK+ page and can't find it in anything but a source tarball (please excuse me if anything i say about stuff sounds stupid, still EXTREMELY new to all this linux stuff! Not an easy transition from windows for me). If anyone has a package though, i would be MORE than happy to use that since i dont have a freakin clue what im doing with the terminal quite yet.

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

it takes some time of yelling and hiting the keyboard before it becomes like second nature try to stick with it you'll get it

i could be wrong but i think this would work in your distro

run the following as a command

sudo apt get install gnome-core-devel build-essential install libgtk2.0-dev libgtk2.0-doc devhelp
HITMANOF44th
Posting Whiz in Training
283 posts since Apr 2009
Reputation Points: 24
Solved Threads: 33
 
sudo apt get install gnome-core-devel build-essential install libgtk2.0-dev libgtk2.0-doc devhelp


this command did not work, but i modified it based on what the terminal was telling me and this is what ended up actually doing something:

sudo apt-get install gnome-core-devel build-essential libgtk2.0-dev libgtk2.0-doc dev-help


is that the same thing or did i install some weird never-get-rid-of-this thing?

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

that would be the same

HITMANOF44th
Posting Whiz in Training
283 posts since Apr 2009
Reputation Points: 24
Solved Threads: 33
 

well, it says it installed the package, but now when i try to use it the programs will not compile. error messages:

Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
first.c:1:21: error: gtk/gtk.h: No such file or directory
first.c: In function ‘main’:
first.c:5: error: ‘GtkWidget’ undeclared (first use in this function)
first.c:5: error: (Each undeclared identifier is reported only once
first.c:5: error: for each function it appears in.)
first.c:5: error: ‘window’ undeclared (first use in this function)
first.c:9: error: ‘GTK_WINDOW_TOPLEVEL’ undeclared (first use in this function)


any ideas?

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

Ok, so i got it all installed, but now when i try to use:

#include <gtk/gtk.h>


to include it, i get errors that the file cannot be found. apparently it was installed at /usr/include/gtk-2.0/gtk/gtk.h. This file is found when i include it, only problem is, when i do, none of the files included in it are found. how do i configure gcc to find these files correctly?

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

Sorry to bump this but now i have another problem... I am compiling using the configuration stated on GTK+ website:

gcc -Wall -g test.c -o test `pkg-config --cflags gtk+-2.0` \ `pkg-config --libs gtk+-2.0`


but i keep getting the following error:

gcc:  -lgtk-x11-2.0: No such file or directory


Im guessing this must be another package or something that i need to install... can anyone tell me what im missing?

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

uhm....excuse me....may i know what ubuntu do you use? because i guess that the command line
"sudo apt-get install libgtk2.0-dev" is enough to install gtk on ubuntu...
or if the application you wish to install is Gnome apps..may be you wish to type the command line
"sudo apt-get install gnome-core-devel"
i'm using ubuntu 9.04 jaunty jackalope and i don't have any trouble with it...

sempal
Newbie Poster
2 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

Im using jaunty as well, 9.04. I guess i'll have a try with that, thank you.

xixpsychoxix
Newbie Poster
14 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

Hey,
take a look at http://ubuntuforums.org/showthread.php?t=375866 .
And tell us what you're going to compile.
Good luck.

mostafadotnet
Junior Poster
157 posts since Jul 2006
Reputation Points: 55
Solved Threads: 11
 

sudo apt-get install gnome-core-devel build-essential libgtk2.0-dev libgtk2.0-doc dev-help
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package dev-help


it doesnt work

i cant install gtk+ .
someone can help me please
firts time i use that SO

xxFGCxx
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 

Hitting better chip

Hitting better chip shots requires a few fundamentals, www.golfwholesale18.com most of which get ishiner overlooked by beginner and better players alike. Let’s look at a few and get your chipping back on track.

smile468
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 

There are a couple of typos in the command given. It should read:
sudo apt-get install gnome-core-devel build-essential libgtk2.0-dev libgtk2.0-doc devhelp

aralk
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: