grimx Posted September 21, 2007 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 Link to comment Share on other sites More sharing options...
neddie Posted September 21, 2007 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. Link to comment Share on other sites More sharing options...
grimx Posted September 21, 2007 Author Share Posted September 21, 2007 ok, i will Link to comment Share on other sites More sharing options...
scarecrow Posted September 22, 2007 Share Posted September 22, 2007 Also, I suppose you have gtk2-devel installed - else you won't be able to build anything... Link to comment Share on other sites More sharing options...
grimx Posted September 22, 2007 Author Share Posted September 22, 2007 yes i have gtk2-devel installed. Link to comment Share on other sites More sharing options...
iphitus Posted September 22, 2007 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now