[ug-bosug] bluetooth stack in user space - gui
Anand Bheemarajaiah
anand_bheemaraju at yahoo.com
Thu May 29 00:48:34 PDT 2008
hello all,
I am trying to use glade in C to build the gui.
here is a hello world program that i was trying to execute and i am stuck with some problems.
here is the code -
-----------------------------------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
void on_button1_clicked(GtkWidget *widget, gpointer user_data) {
printf("Hello world!!");
}
int main(int argc, char *argv[]) {
GladeXML *xml;
gtk_init_check(&argc, &argv);
/* load the interface */
xml = glade_xml_new("/export/home/anand/temp.glade", NULL, NULL);
/* connect the signals in the interface */
glade_xml_signal_autoconnect(xml);
/* start the event loop */
gtk_main();
return 0;
}
-----------------------------------------------------------------------------------------------------------
here is the output of build -
-----------------------------------------------------------------------------------------------------------
Running "/opt/Sun_Studio_12_Feb_Build/SUNWspro/bin/dmake -f Makefile CONF=Debug" in /export/home/anand/SunStudioProjects/test_glade
dmake: defaulting to parallel mode.
See the man page dmake(1) for more information on setting up the .dmakerc file.
solaris-devx --> 1 job
/opt/Sun_Studio_12_Feb_Build/SUNWspro/bin/dmake -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
solaris-devx --> 1 job
mkdir -p build/Debug/Sun12-Solaris-x86
cc -L/usr/sfw/lib -R/usr/sfw/lib -lgtk -lgdk -lglib-2.0 -lglade-2.0 -c -g -I/usr/include -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/include/cairo -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -o build/Debug/Sun12-Solaris-x86/glademain.o glademain.c
solaris-devx --> Job output
mkdir -p build/Debug/Sun12-Solaris-x86
cc -L/usr/sfw/lib -R/usr/sfw/lib -lgtk -lgdk -lglib-2.0 -lglade-2.0 -c -g -I/usr/include -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/include/cairo -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -o build/Debug/Sun12-Solaris-x86/glademain.o glademain.c
(/export/home/anand/SunStudioProjects/test_glade)glademain.c:
:(/export/home/anand/SunStudioProjects/test_glade)glademain.c
solaris-devx --> 1 job
mkdir -p dist/Debug/Sun12-Solaris-x86
cc -L/usr/sfw/lib -R/usr/sfw/lib -lgtk -lgdk -lglib-2.0 -lglade-2.0 -o dist/Debug/Sun12-Solaris-x86/test_glade build/Debug/Sun12-Solaris-x86/glademain.o
Build successful. Exit value 0.
-----------------------------------------------------------------------------------------------------------
It used to give this output -
-----------------------------------------------------------------------------------------------------------
(process:1059): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use g_type_init() prior to this function
(process:1059): GLib-GObject-CRITICAL **: file gobject.c: line 792: assertion `G_TYPE_IS_OBJECT (object_type)' failed
(process:1059): libglade-CRITICAL **: file glade-xml.c: line 179: assertion `self != NULL' failed
(process:1059): GLib-GObject-CRITICAL **: file gobject.c: line 1737: assertion `G_IS_OBJECT (object)' failed
(process:1059): libglade-CRITICAL **: file glade-xml.c: line 324: assertion `self != NULL' failed
-----------------------------------------------------------------------------------------------------------
but i messed around with gobject and g_type_init and then the same code is now giving a segmentation fault at gtk_init.
Any pointers ?
regards,
Anand B
This message posted from opensolaris.org
More information about the ug-bosug
mailing list