On Mon, 20 Jul 2009 22:26:52 -0400
Braden McDaniel <bra...@endoframe.com> wrote:

> On Tue, 2009-07-21 at 12:20 +1000, Mick wrote:
> > On Mon, 20 Jul 2009 12:17:32 -0400
> > Braden McDaniel <bra...@endoframe.com> wrote:
> > 
> > > On Mon, 2009-07-20 at 11:22 +1000, Mick wrote:
> > > 
> > > [snip]
> > > 
> > > > compiling with:
> > > > gcc -Wall -g -o tutor main.c -export-dynamic `pkg-config
> > > > --cflags
> > > > --libs gtk+-2.0` produces an executable that runs just as
> > > > expected.
> > > > 
> > > > When I split the .c file into the main function as main.c and
> > > > the 'callbacks' into callback.c and create the Makefile.am,
> > > > configure.in, etc compilation runs without error and the exec
> > > > runs but hangs after displaying: Gtk-CRITICAL **:
> > > > gtk_widget_show: assertion `GTK_IS_WIDGET (widget)' failed
> > > > 
> > > > on:
> > > >  gtk_widget_show(chat_window);
> > 
> > Thanks for your help and critique, I've taken your advice on board:
> > 
> > > You need to add -export-dynamic to AM_LDFLAGS in Makefile.am.
> > src/Makefile.am
> > <code>
> > bin_PROGRAMS = nuchimp
> > 
> > nuchimp_SOURCES = \
> >     callback.c callback.h \
> >     main.c main.h 
> > 
> > AM_CPPFLAGS $(GTK_CFLAGS)
> > AM_LDFLAGS -export-dynamic
> 
> You're missing some '=' signs here; e.g.:
> 
>         AM_CPPFLAGS = $(GTK_CFLAGS)
> 
> That's probably the source of your error.
> 
> > I removed several paragraphs that defined install/uninstall after
> > getting this error but it remains.
> 
> Looking at Automake's output can be very educational; but unless you
> really know what you're doing, you probably shouldn't bother editing
> it. If the generated Makefile has errors, it's almost certainly
> because there were errors in the input.
should have said removed from Makefile.am.

Now the source compiles but linking produces:
gcc  -Wall -g -O2 -export-dynamic  -o nuchimp callback.o main.o  
callback.o: In function `on_panicbutton_clicked':
/home/mick/Projects/nuchimp/src/callback.c:62: undefined reference to
`gtk_widget_destroy' callback.o: In function `on_quit_activate':
/home/mick/Projects/nuchimp/src/callback.c:40: undefined reference to
`gtk_main_quit' callback.o: In function `on_chat_window_destroy':
/home/mick/Projects/nuchimp/src/callback.c:14: undefined reference to
`gtk_main_quit' callback.o: In function `on_connect_activate':
/home/mick/Projects/nuchimp/src/callback.c:29: undefined reference to
`gtk_widget_show_all' main.o: In function `main':
/home/mick/Projects/nuchimp/src/main.c:15: undefined reference to
`gtk_init' /home/mick/Projects/nuchimp/src/main.c:17: undefined
reference to
`gtk_builder_new' /home/mick/Projects/nuchimp/src/main.c:18: undefined
reference to
`gtk_builder_add_from_file' /home/mick/Projects/nuchimp/src/main.c:20:
undefined reference to
`gtk_widget_get_type' /home/mick/Projects/nuchimp/src/main.c:20:
undefined reference to
`gtk_builder_get_object' /home/mick/Projects/nuchimp/src/main.c:20:
undefined reference to
`g_type_check_instance_cast' /home/mick/Projects/nuchimp/src/main.c:21:
undefined reference to
`gtk_builder_get_object' /home/mick/Projects/nuchimp/src/main.c:21:
undefined reference to
`g_type_check_instance_cast' /home/mick/Projects/nuchimp/src/main.c:22:
undefined reference to
`gtk_builder_connect_signals' /home/mick/Projects/nuchimp/src/main.c:23:
undefined reference to
`g_type_check_instance_cast' /home/mick/Projects/nuchimp/src/main.c:23:
undefined reference to
`g_object_unref' /home/mick/Projects/nuchimp/src/main.c:25: undefined
reference to
`gtk_widget_show' /home/mick/Projects/nuchimp/src/main.c:26: undefined
reference to `gtk_main'
collect2: ld returned 1 exit status

I tried explicitly '#include'ing the headers that defined these
functions with no change. 

Help, my brian is melting




_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to