Newsgroup: it.comp.os.linux.development
Titolo: Programmare in Gnome GTK

Ho scritto un piccolo programmino in gnome/GTK, trovato nella documentazione 
di GTK e ho fatto il seguente file Makefile come da documentazione:
CC      = gcc
CFLAGS  = -g -Wall `gnome-config --cflags gnome gnomeui`
LDFLAGS = `gnome_config --libs gnome gnomeui`
all: hello.c
        $(CC) $(CFLAGS) $(LDFLAGS) -o hello hello.c
clean:
        /bin/rm -f *.o *~
ma quando compilo il programma...:
[keres@localhost 2lession]$ make
gcc -g -Wall `gnome-config --cflags gnome gnomeui` `gnome_config --libs 
gnome gnomeui` -o hello hello.c
/bin/sh: line 1: gnome_config: command not found
hello.c: In function `about_hello':
hello.c:19: `James' undeclared (first use in this function)
hello.c:19: (Each undeclared identifier is reported only once
hello.c:19: for each function it appears in.)
hello.c:19: parse error before "Bond"
hello.c:22: `VERSION' undeclared (first use in this function)
hello.c: At top level:
hello.c:47: `GNOMEUINFO_END' undeclared here (not in a function)
hello.c:47: initializer element is not constant
hello.c:47: (near initialization for `main_menu[2]')
hello.c: In function `main':
hello.c:54: `VERSION' undeclared (first use in this function)
hello.c:59: warning: implicit declaration of function `GOME_APP'
hello.c:59: warning: passing arg 1 of `gnome_app_create_menus' makes pointer 
from integer without a cast
hello.c:61: warning: implicit declaration of function `gnome_app_bar_new'
hello.c:61: warning: assignment makes pointer from integer without a cast
hello.c:62: warning: passing arg 1 of `gnome_app_set_statusbar' makes 
pointer from integer without a cast
hello.c:64: warning: implicit declaration of function `GONME_APP'
hello.c:64: warning: passing arg 1 of `gnome_app_install_menu_hints' makes 
pointer from integer without a cast
hello.c:66:28: warning: unknown escape sequence '\h'
hello.c:68: warning: passing arg 1 of `gnome_app_set_contents' makes pointer 
from integer without a cast
make: *** [all] Error 1
E questo è il codice sorgente del programmino...
#include <gnome.h>
#define VERISON "1.0"
static void exit_hello( GtkWidget *window, gpointer data )
{
        gtk_main_quit();
}
static int delete_event( GtkWidget *window, gpointer data )
{
        gtk_main_quit();
        return FALSE;
}
static void about_hello( GtkWidget *window, gpointer data )
{
        GtkWidget *box;
        const char *authors[]={ James Bond, NULL };
        box = gnome_about_new( "Hello World (GNOME EDITION)",
                                VERSION,
                                "(C) 2002 Secret Agents Inc.",
                                authors,
                                "An extremly complicated application wh
ich does absolutely nothing useful",
                                NULL );
        gtk_widget_show( box );
}
static GnomeUIInfo file_menu[]={
                GNOMEUIINFO_ITEM_NONE( "Something", "Just an item which d
oes nothing", NULL ),
                GNOMEUIINFO_MENU_EXIT_ITEM( exit_hello, NULL ),
                GNOMEUIINFO_END
        };
 
static GnomeUIInfo help_menu[]={
                GNOMEUIINFO_HELP( "hello_world" ),
                GNOMEUIINFO_MENU_ABOUT_ITEM( about_hello, NULL ),
                GNOMEUIINFO_END
        };
static GnomeUIInfo main_menu[]={
                GNOMEUIINFO_MENU_FILE_TREE( file_menu ),
                GNOMEUIINFO_MENU_HELP_TREE( help_menu ),
                GNOMEUINFO_END
        };
int main( int argc, char *argv[])
{
        GtkWidget *app;
        GtkWidget *w;
        gnome_init( "Hello_world", VERSION, argc, argv );
        app = gnome_app_new( "Hello_world", "Hello World (GNOME EDITION)" );
        gtk_signal_connect( GTK_OBJECT( app ), "delete_event", GTK_SIGNAL
_FUNC( delete_event ), NULL );
 
        gnome_app_create_menus( GOME_APP( app ), main_menu );
 
        w = gnome_app_bar_new( FALSE, TRUE, GNOME_PREFERENCES_USER );
        gnome_app_set_statusbar( GOME_APP( app ), w );
        gnome_app_install_menu_hints( GONME_APP( app ), main_menu );
        w = gtk_label_new( "Some really really really random\ntext\ngoes\here!" );
        gnome_app_set_contents( GONME_APP( app ), w );
 
        gtk_widget_show_all( app );
 
        gtk_main();
 
        return 0;
}
Cosa devo fare per farlo compilare?
Grazie...

 Cosa devo fare per farlo compilare?
Leggere i messaggi di errore.
Bye.

 Cosa devo fare per farlo compilare?
leggere e capire l'output di gcc, ad esempio.
-- 
HappyCactus - Linux User #209744 - LFS User #6046 - >>> SMSPM1050 <<<
              YAGF Member Group >>> 
www.google.com
 <<<
Ci sono 10 categorie di persone al mondo: quelle che capiscono
il sistema binario e quelle che non lo capiscono.

 Cosa devo fare per farlo compilare?
1. Correggere gli errori del sorgente...
2. Imparare a leggere l'output di gcc.
Ciao,
 Emmanuele.
-- 
Emmanuele Bassi (Zefram)           [ 
http://www.radiance.ods.org/~zefram
 ]
GnuPG Key fingerprint = 4DD0 C90D 4070 F071 5738  08BD 8ECC DB8F A432 0FF4