[opensuse-programming] "#include <gtk.h>" fails in gcc on SuSE 10.3
To begin learning GTK, I submitted the following one line C program: #include <gtk/gtk.h> That received an error message. After looking in /usr/include, I tried: #include <gtk-2.0/gtk/gtk.h> That received several error messages. Tried editing all the included "gtk..." lines to "gtk-2.0...". That received floods of error messages. What am I doing wrong? or is the SL 10.3 include file broken? All I want to do is key in the "helloworld.c" program on p. 16 of Andrew Krause's 2007 book "Foundations of GTK+ Development". Starting with a one line C program, just the #include statement, seemed easy enough, but it is not. Thanks, davide --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On Saturday 14 June 2008 17:05:00 David E wrote:
To begin learning GTK, I submitted the following one line C program: #include <gtk/gtk.h> That received an error message. After looking in /usr/include, I tried: #include <gtk-2.0/gtk/gtk.h> That received several error messages. Tried editing all the included "gtk..." lines to "gtk-2.0...". That received floods of error messages.
What am I doing wrong? or is the SL 10.3 include file broken? All I want to do is key in the "helloworld.c" program on p. 16 of Andrew Krause's 2007 book "Foundations of GTK+ Development". Starting with a one line C program, just the #include statement, seemed easy enough, but it is not.
You need to have a few parameters on your gcc command line. The normal way is to get those from pkgconfig. Try gcc -o testgtk $(pkg-config --cflags gtk+-2.0) testgtk.c Anders --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On Sat, 2008-06-14 at 17:19 +0200, Anders Johansson wrote:
On Saturday 14 June 2008 17:05:00 David E wrote:
To begin learning GTK, I submitted the following one line C program: #include <gtk/gtk.h> That received an error message. After looking in /usr/include, I tried: #include <gtk-2.0/gtk/gtk.h> That received several error messages. Tried editing all the included "gtk..." lines to "gtk-2.0...". That received floods of error messages.
What am I doing wrong? or is the SL 10.3 include file broken? All I want to do is key in the "helloworld.c" program on p. 16 of Andrew Krause's 2007 book "Foundations of GTK+ Development". Starting with a one line C program, just the #include statement, seemed easy enough, but it is not.
You need to have a few parameters on your gcc command line. The normal way is to get those from pkgconfig. Try
gcc -o testgtk $(pkg-config --cflags gtk+-2.0) testgtk.c
Anders Thanks. Problem solved. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
--------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
participants (2)
-
Anders Johansson
-
David E