LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with gtk+ toolkit.. (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-gtk-toolkit-689579/)

Sanjib_Sur 12-10-2008 08:30 AM

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?

colucix 12-10-2008 08:39 AM

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).

Sanjib_Sur 12-10-2008 08:45 AM

How to install gtk+-devel? Please tell me.

colucix 12-10-2008 08:53 AM

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.

Sanjib_Sur 12-10-2008 08:59 AM

Ok, I have installed gtk+-devel. Now what to do? Giving me the same problem while installing!!

Sanjib_Sur 12-10-2008 09:05 AM

Sorry, to my last post, the line "Giving me the same problem while installing!!" should be "Giving me the same problem after installing". Sorry!

colucix 12-10-2008 09:42 AM

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


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