grimx Posted September 21, 2007 Report Share Posted September 21, 2007 (edited) ok i have gtk2.0 installed i got this from the book called "Beginning Linux Programming, Second Edition. by Wrox Press 2003" when i try to compiling this #include <gnome.h> int main (int argc, char *argv[]) { GtkWidget *app; gnome_init ("example", "0.1", argc, argv); app = gnome_app_new ("example", "Window Title"); gtk_widget_show (app); gtk_main (); return 0; } i get this gcc gnome1.c -o example1 `gnome-config --cflags --libs gnomeui` bash: gnome-config: command not found gnome1.c:1:19: error: gnome.h: No such file or directory gnome1.c: In function ‘main’: gnome1.c:5: error: ‘GtkWidget’ undeclared (first use in this function) gnome1.c:5: error: (Each undeclared identifier is reported only once gnome1.c:5: error: for each function it appears in.) gnome1.c:5: error: ‘app’ undeclared (first use in this function) Help Edited September 21, 2007 by grimx Quote Link to comment Share on other sites More sharing options...
neddie Posted September 21, 2007 Report Share Posted September 21, 2007 Syntax can change a lot in 4 years since that book came out, with library changes, api changes, compiler version changes etc. It seems it can't find your gnome.h header file but that could be for a number of reasons. Why not stick to a Gtk2.0-specific tutorial, like for example http://www.gtk.org/tutorial/ ? Their first example uses #include <gtk/gtk.h> rather than gnome.h and uses for example gtk_init rather than gnome_init. Quote Link to comment Share on other sites More sharing options...
grimx Posted September 21, 2007 Author Report Share Posted September 21, 2007 ok, i will Quote Link to comment Share on other sites More sharing options...
scarecrow Posted September 22, 2007 Report Share Posted September 22, 2007 Also, I suppose you have gtk2-devel installed - else you won't be able to build anything... Quote Link to comment Share on other sites More sharing options...
grimx Posted September 22, 2007 Author Report Share Posted September 22, 2007 yes i have gtk2-devel installed. Quote Link to comment Share on other sites More sharing options...
iphitus Posted September 22, 2007 Report Share Posted September 22, 2007 There's probably a gnome devel lib needed too, try libgnome-devel. GTK is NOT gnome specific, so the gnome headers are in a seperate package, as they're entirely separate. James Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.