Hi all, I'm trying to do some programming with GTK.
I have everything installed libs and includes and GTK applications run fine.
But trying to compile this simple program...
#include <gtk/gtk.h>
int main( int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gtk_main();
return 0;
}
I get a whole bunch of errors.
make all
Building file: ../Test.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Test.d" -MT"Test.d" -o"Test.o" "../Test.cpp"
In file included from /usr/include/glib-2.0/glib/gtypes.h:35,
from /usr/include/glib-2.0/glib/galloca.h:34,
from /usr/include/glib-2.0/glib.h:32,
from /usr/include/glib-2.0/gobject/gbinding.h:30,
from /usr/include/glib-2.0/glib-object.h:25,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from ../Test.cpp:8:
/usr/include/glib-2.0/glib/gmacros.h:47: warning: "G_GNUC_EXTENSION" redefined
/usr/include/glib-2.0/glibconfig.h:38: note: this is the location of the previous definition
In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:34,
from /usr/include/glib-2.0/glib.h:34,
from /usr/include/glib-2.0/gobject/gbinding.h:30,
from /usr/include/glib-2.0/glib-object.h:25,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from ../Test.cpp:8:
/usr/include/glib-2.0/glib/gthread.h:271: error: ‘GSystemThread’ does not name a type
In file included from /usr/include/glib-2.0/glib/giochannel.h:35,
from /usr/include/glib-2.0/glib.h:53,
from /usr/include/glib-2.0/gobject/gbinding.h:30,
from /usr/include/glib-2.0/glib-object.h:25,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from ../Test.cpp:8:
/usr/include/glib-2.0/glib/gmain.h:136: error: typedef ‘GChildWatchFunc’ is initialized (use decltype instead)
/usr/include/glib-2.0/glib/gmain.h:136: error: ‘GPid’ was not declared in this scope
/usr/include/glib-2.0/glib/gmain.h:137: error: expected primary-expression before ‘status’
/usr/include/glib-2.0/glib/gmain.h:138: error: expected primary-expression before ‘data’
/usr/include/glib-2.0/glib/gmain.h:376: error: ‘GPid’ was not declared in this scope
/usr/include/glib-2.0/glib/gmain.h:509: error: ‘GPid’ has not been declared
/usr/include/glib-2.0/glib/gmain.h:510: error: ‘GChildWatchFunc’ has not been declared
/usr/include/glib-2.0/glib/gmain.h:513: error: ‘GPid’ was not declared in this scope
/usr/include/glib-2.0/glib/gmain.h:514: error: ‘GChildWatchFunc’ was not declared in this scope
/usr/include/glib-2.0/glib/gmain.h:515: error: expected primary-expression before ‘data’
/usr/include/glib-2.0/glib/gmain.h:515: error: initializer expression list treated as compound expression
In file included from /usr/include/glib-2.0/glib.h:61,
from /usr/include/glib-2.0/gobject/gbinding.h:30,
from /usr/include/glib-2.0/glib-object.h:25,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from ../Test.cpp:8:
/usr/include/glib-2.0/glib/gmessages.h:110: error: expected constructor, destructor, or type conversion before ‘void’
In file included from /usr/include/glib-2.0/glib.h:78,
from /usr/include/glib-2.0/gobject/gbinding.h:30,
from /usr/include/glib-2.0/glib-object.h:25,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from ../Test.cpp:8:
/usr/include/glib-2.0/glib/gspawn.h:92: error: ‘GPid’ has not been declared
/usr/include/glib-2.0/glib/gspawn.h:105: error: ‘GPid’ has not been declared
/usr/include/glib-2.0/glib/gspawn.h:135: error: variable or field ‘g_spawn_close_pid’ declared void
/usr/include/glib-2.0/glib/gspawn.h:135: error: ‘GPid’ was not declared in this scope
In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
from /usr/include/glib-2.0/gobject/gbinding.h:31,
from /usr/include/glib-2.0/glib-object.h:25,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from ../Test.cpp:8:
/usr/include/glib-2.0/gobject/gtype.h:1665: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1666: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1667: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1668: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1669: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1670: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1671: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1672: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/glib-2.0/gobject/gtype.h:1673: error: expected constructor, destructor, or type conversion before ‘void’
In file included from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from ../Test.cpp:8:
/usr/include/glib-2.0/gio/gioenums.h:630: error: ‘GLIB_SYSDEF_AF_INET’ was not declared in this scope
/usr/include/glib-2.0/gio/gioenums.h:631: error: ‘GLIB_SYSDEF_AF_INET6’ was not declared in this scope
/usr/include/glib-2.0/gio/gioenums.h:676: error: ‘GLIB_SYSDEF_MSG_OOB’ was not declared in this scope
/usr/include/glib-2.0/gio/gioenums.h:677: error: ‘GLIB_SYSDEF_MSG_PEEK’ was not declared in this scope
/usr/include/glib-2.0/gio/gioenums.h:678: error: ‘GLIB_SYSDEF_MSG_DONTROUTE’ was not declared in this scope
/usr/include/glib-2.0/glib/gutils.h:301: warning: ‘gint g_bit_nth_lsf(gulong, gint)’ declared ‘static’ but never defined
/usr/include/glib-2.0/glib/gutils.h:303: warning: ‘gint g_bit_nth_msf(gulong, gint)’ declared ‘static’ but never defined
/usr/include/glib-2.0/glib/gutils.h:305: warning: ‘guint g_bit_storage(gulong)’ declared ‘static’ but never defined
/usr/include/glib-2.0/glib/gutils.h:316: warning: ‘void g_trash_stack_push(GTrashStack**, void*)’ declared ‘static’ but never defined
/usr/include/glib-2.0/glib/gutils.h:318: warning: ‘void* g_trash_stack_pop(GTrashStack**)’ declared ‘static’ but never defined
/usr/include/glib-2.0/glib/gutils.h:319: warning: ‘void* g_trash_stack_peek(GTrashStack**)’ declared ‘static’ but never defined
/usr/include/glib-2.0/glib/gutils.h:320: warning: ‘guint g_trash_stack_height(GTrashStack**)’ declared ‘static’ but never defined
/usr/include/glib-2.0/glib/gthread.h:339: warning: ‘gboolean g_once_init_enter(volatile gsize*)’ declared ‘static’ but never defined
make: *** [Test.o] Error 1
There were some more but I discovered some declarations in various include files that were commented out. I removed the comments and some of those errors were gone.
I'm thinking I have the wrong development package. I'm using the package that installed with Ubuntu 10.10
I've also compared header files with these packages
gtk+-2.22.0
pango-1.28.3
glib-2.26.0
I can't find any differences
Anybody have any ideas ??????
Bookmarks