LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-10-2008, 09:30 AM   #1
Sanjib_Sur
LQ Newbie
 
Registered: Oct 2008
Posts: 13

Rep: Reputation: 0
Question Problem with gtk+ toolkit..


Hi, I'm using Fedora8. Now as beginner in C programming I want to do some GUI program using gtk+ toolkit in gcc. Now I thought that gtk+ is not installed to my system and even not in the DVD of fedora8! So, I did the following,
yum install gtk+
It says that,
Package gtk+ - 1:1.2.10-59.fc8.i386 is already installed.
Nothing to do
So, nothing to worry about!
Now to my surprise whenever I try to compile a program using gtk+ (means that I included those libraries needed to successfully compile and run my program) I get error message indicating that,
gtk/gtk.h: No such file or directory
I'm giving that source code as an example,
#include <gtk/gtk.h>

int main( int argc, char *argv[])
{
GtkWidget *window;

gtk_init(&argc, &argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);

gtk_main();

return 0;
}
So, please tell me whats wrong with that?and what I have to do now?
 
Old 12-10-2008, 09:39 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
You have to install the gtk+-devel package. This is what -devel packages are meant for: build applications against the provided libraries and headers. Without the -devel package you have only binaries to run that specific application (or eventually just a shared library to use when running some other application).
 
Old 12-10-2008, 09:45 AM   #3
Sanjib_Sur
LQ Newbie
 
Registered: Oct 2008
Posts: 13

Original Poster
Rep: Reputation: 0
How to install gtk+-devel? Please tell me.
 
Old 12-10-2008, 09:53 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
In the same way you've tried to install gtk+
Code:
yum install gtk+-devel
or use the Add/Remove Software application, if you prefer a graphical installer.
 
Old 12-10-2008, 09:59 AM   #5
Sanjib_Sur
LQ Newbie
 
Registered: Oct 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Ok, I have installed gtk+-devel. Now what to do? Giving me the same problem while installing!!
 
Old 12-10-2008, 10:05 AM   #6
Sanjib_Sur
LQ Newbie
 
Registered: Oct 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Sorry, to my last post, the line "Giving me the same problem while installing!!" should be "Giving me the same problem after installing". Sorry!
 
Old 12-10-2008, 10:42 AM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Which command did you run to compile the program? And which is the exact output (or the first part of it)?
 
  


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
problem with netops-toolkit djamols Linux - Software 0 10-03-2008 12:33 PM
Adobe reader installed but doesnt work, GTK UI toolkit ver 2.4 missing humtum06 Linux - Software 4 05-24-2006 03:42 PM
java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit artemis8543 Linux - Newbie 4 05-16-2006 09:38 PM
GTK+ UI Toolkit libraries, ver. 2.4 or greater were not found cs95aam Linux - Software 1 01-27-2006 03:33 PM
GIMP Toolkit - Glib/GTK+ Version Problem lucky6969b Programming 1 01-05-2006 06:16 PM


All times are GMT -5. The time now is 02:36 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration