Jump to content

gtk programming


Recommended Posts

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 by grimx
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...