Compiling problems
- From: Christopher Shaffer <cherokeestargazer yahoo com>
- To: gtk-app-devel-list gnome org
- Subject: Compiling problems
- Date: Thu, 3 Apr 2003 05:34:53 -0800 (PST)
Thanks to everyone for helping me to get gtk installed. Now, I'm trying to run the first app from
the tutorial:
http://gtk.org/tutorial/ch-gettingstarted.html
But when I run gcc as they say, this is the output:
---------------------------
[root g3216064 tutorial]# gcc base.c -o base 'pkg-config --cflags --libs gtk+-2.0'
gcc: pkg-config --cflags --libs gtk+-2.0: No such file or directory
base.c:1:21: gtk/gtk.h: No such file or directory
base.c: In function `main':
base.c:6: `GtkWidget' undeclared (first use in this function)
base.c:6: (Each undeclared identifier is reported only once
base.c:6: for each function it appears in.)
base.c:6: `window' undeclared (first use in this function)
base.c:10: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)
---------------------------
Now, when I run pkg-config on the commandline by itself, I get a bunch of compiler flags on the
output, so I ran this:
---------------------------
[root g3216064 tutorial]# gcc base.c -o base -I/usr/local/lib/gtk-2.0
-I/usr/local/lib/gtk-2.0/include -I/usr/local/include/atk-1.0 -I/usr/local/include/pango-1.0
-I/usr/X11R6/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
-Wl,--export-dynamic -L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
-lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
---------------------------
And I still recieve an error message about not being able to find gtk.h. So, I manually found
gtk.h, and added that path as an include option on the above command line sting
(-I/usr/local/include/gtk-2.0), and I finally got the the short program to compile. My question
is: is there an easy way to do this? I thought the point of pkg-config was to make it easy to
generate the correct options at compile time? Am I missing something? Does gcc need to be setup
to use pkg-config? Forgive, I know C, but my compiler knowledge is very, very shallow (came from
a windows worlds with Visual C++. I'm really sorry I ever learned it...).
Also, anyone know of any good, intro tutorials to using gcc? I know I can read the docs, but
maybe something is out there for an idiot like me.
Chris
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]