anewguy
April 22nd, 2008, 05:38 AM
I have been following one of the online tutorials for using Glade and GTK. In the very first sample program (it only creates a window and destroys it when the box is clicked) it has the following lines:
/*
To compile, use this command (those are backticks, not single quotes):
gcc -Wall -g -o tutorial main.c `pkg-config --cflags --libs gtk+-2.0 libglade-2.0`
*/
As far as I can tell, I think I have GTK installed, but when I run the above gcc (changed to match my source name) I get the following:
dave@dave-desktop:~/cvsutil/src$ gcc -Wall -g -o cvsutil cvsutilgtk.c `pkg-config --cflags --libs gtk+-2.0 libglade-2.0`
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
Package libglade-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libglade-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libglade-2.0' found
cvsutilgtk.c:5:21: error: gtk/gtk.h: No such file or directory
cvsutilgtk.c:6:25: error: glade/glade.h: No such file or directory
cvsutilgtk.c: In function ‘main’:
cvsutilgtk.c:11: error: ‘GladeXML’ undeclared (first use in this function)
cvsutilgtk.c:11: error: (Each undeclared identifier is reported only once
cvsutilgtk.c:11: error: for each function it appears in.)
cvsutilgtk.c:11: error: ‘gxml’ undeclared (first use in this function)
cvsutilgtk.c:12: error: ‘GtkWidget’ undeclared (first use in this function)
cvsutilgtk.c:12: error: ‘window’ undeclared (first use in this function)
cvsutilgtk.c:14: warning: implicit declaration of function ‘gtk_init’
cvsutilgtk.c:16: warning: implicit declaration of function ‘glade_xml_new’
cvsutilgtk.c:16: error: ‘NULL’ undeclared (first use in this function)
cvsutilgtk.c:17: warning: implicit declaration of function ‘glade_xml_get_widget’
cvsutilgtk.c:18: warning: implicit declaration of function ‘glade_xml_signal_connect’
cvsutilgtk.c:19: warning: implicit declaration of function ‘G_CALLBACK’
cvsutilgtk.c:19: error: ‘gtk_main_quit’ undeclared (first use in this function)
cvsutilgtk.c:21: warning: implicit declaration of function ‘g_object_unref’
cvsutilgtk.c:21: warning: implicit declaration of function ‘G_OBJECT’
cvsutilgtk.c:23: warning: implicit declaration of function ‘gtk_widget_show’
cvsutilgtk.c:24: warning: implicit declaration of function ‘gtk_main’
dave@dave-desktop:~/cvsutil/src$
I know after it not finding the gtk package that everything else is a result of that.
What should a beginner like me do?
Thanks! :)
EDIT: Forgot to mention that glade and gtk seem to be installed in /usr/lib if that helps any.
/*
To compile, use this command (those are backticks, not single quotes):
gcc -Wall -g -o tutorial main.c `pkg-config --cflags --libs gtk+-2.0 libglade-2.0`
*/
As far as I can tell, I think I have GTK installed, but when I run the above gcc (changed to match my source name) I get the following:
dave@dave-desktop:~/cvsutil/src$ gcc -Wall -g -o cvsutil cvsutilgtk.c `pkg-config --cflags --libs gtk+-2.0 libglade-2.0`
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
Package libglade-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libglade-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libglade-2.0' found
cvsutilgtk.c:5:21: error: gtk/gtk.h: No such file or directory
cvsutilgtk.c:6:25: error: glade/glade.h: No such file or directory
cvsutilgtk.c: In function ‘main’:
cvsutilgtk.c:11: error: ‘GladeXML’ undeclared (first use in this function)
cvsutilgtk.c:11: error: (Each undeclared identifier is reported only once
cvsutilgtk.c:11: error: for each function it appears in.)
cvsutilgtk.c:11: error: ‘gxml’ undeclared (first use in this function)
cvsutilgtk.c:12: error: ‘GtkWidget’ undeclared (first use in this function)
cvsutilgtk.c:12: error: ‘window’ undeclared (first use in this function)
cvsutilgtk.c:14: warning: implicit declaration of function ‘gtk_init’
cvsutilgtk.c:16: warning: implicit declaration of function ‘glade_xml_new’
cvsutilgtk.c:16: error: ‘NULL’ undeclared (first use in this function)
cvsutilgtk.c:17: warning: implicit declaration of function ‘glade_xml_get_widget’
cvsutilgtk.c:18: warning: implicit declaration of function ‘glade_xml_signal_connect’
cvsutilgtk.c:19: warning: implicit declaration of function ‘G_CALLBACK’
cvsutilgtk.c:19: error: ‘gtk_main_quit’ undeclared (first use in this function)
cvsutilgtk.c:21: warning: implicit declaration of function ‘g_object_unref’
cvsutilgtk.c:21: warning: implicit declaration of function ‘G_OBJECT’
cvsutilgtk.c:23: warning: implicit declaration of function ‘gtk_widget_show’
cvsutilgtk.c:24: warning: implicit declaration of function ‘gtk_main’
dave@dave-desktop:~/cvsutil/src$
I know after it not finding the gtk package that everything else is a result of that.
What should a beginner like me do?
Thanks! :)
EDIT: Forgot to mention that glade and gtk seem to be installed in /usr/lib if that helps any.