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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...