Re: Help on compiling notebook example
- From: Krzesimir Nowak <qdlacz gmail com>
- To: Chun Yang <achunyang2010 gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Help on compiling notebook example
- Date: Sat, 18 Dec 2010 08:54:25 +0100
On Thu, 2010-12-16 at 23:49 -0800, Chun Yang wrote:
> Hi All,
>
> Sorry again. I kept pressing some button I was not aware and sent this
> email again.
>
> Here are my question:
> 1. What are the warning (highlighted in green) after I started to run
> the program?
> 2. What is the reason for me to get all the warnings (in blue) and the
> error (in red)? I can not continue the program due to the error.
> 3. How do I fix the error?
>
I see 3 questions, not 2. :) And one thing - especially for you I
switched my mail view to HTML instead of plaintext, but still all the
text is black on white. But probably I can guess what is what.
1. Some prelink + gdb issues, probably nothing you should be worrying
about now. If you want some reading, here is the link:
http://www.cygwin.com/ml/gdb-patches/2006-02/msg00164.html
2. The warnings are displayed because when CGraphView::_pageMenuLabel is
constructed, a GType system is not yet initialized. And it is not
initialized because static members are constructed before main() is
started.
3. Seems that widgets cannot be static members. So a fix could be making
it a nonstatic member of the class. Or, if you want it to be static
anyway, make it a pointer. And in constructor of CGraphView you could
check if this pointer is zero. If so - create a button, otherwise do
nothing. But don't forget to delete it at some point or you'll get a
memory leak.
> Thanks,
> Chun
>
Krzesimir
> On Thu, Dec 16, 2010 at 11:45 PM, Chun Yang <achunyang2010 gmail com>
> wrote:
>
> Sorry I pressed the wrong button.
>
> Let me continue.
>
> I have the following code:
>
> In my .h file, I have:
> class CGraphView : public Gtk::ScrolledWindow
> {
> ..... .....
> static Gtk::Button _pageMenuLabel;
> };
>
> In my .cpp I have:
>
> Gtk::Button CGraphView::_pageMenuLabel("X");
>
>
> I planned to use _pageMenuLabel as an page to Gtk::Notebook as
> in:
> append_page(* graph_view, graph_view->_pageTabLabel,
> CGraphView::_pageMenuLabel);
> After I compile and run gdb with breakpoint set on the above
> line, I got the following.
>
> I got two questions to asked
>
>
>
> (gdb) r
> Starting program: /proj/utool/gui/build/utool
> warning: .dynamic section for
> "/usr/lib/libpangocairo-1.0.so.0" is not at the expected
> address
> warning: difference appears to be caused by prelink, adjusting
> expectations
> warning: .dynamic section for "/usr/lib/libpango-1.0.so.0" is
> not at the expected address
> warning: difference appears to be caused by prelink, adjusting
> expectations
> warning: .dynamic section for "/usr/lib/libX11.so.6" is not at
> the expected address
> warning: difference appears to be caused by prelink, adjusting
> expectations
> warning: .dynamic section for "/lib/libz.so.1" is not at the
> expected address
> warning: difference appears to be caused by prelink, adjusting
> expectations
> [Thread debugging using libthread_db enabled]
>
> Breakpoint 2, __static_initialization_and_destruction_0
> (__initialize_p=1, __priority=65535) at src/CGraphView.cpp:6
> (gdb) n
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-CRITICAL **: g_once_init_leave: assertion
> `initialization_value != 0' failed
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **:
> g_type_add_interface_static: assertion
> `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **:
> g_type_add_interface_static: assertion
> `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **:
> g_type_add_interface_static: assertion
> `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-CRITICAL **: g_once_init_leave: assertion
> `initialization_value != 0' failed
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): GLib-GObject-CRITICAL **:
> g_type_add_interface_static: assertion
> `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
>
> (process:3431): GLib-CRITICAL **: g_once_init_leave: assertion
> `initialization_value != 0' failed
>
> (process:3431): GLib-GObject-WARNING **: cannot retrieve class
> for invalid (unclassed) type `<invalid>'
>
> (process:3431): GLib-GObject-CRITICAL **:
> g_object_class_find_property: assertion `G_IS_OBJECT_CLASS
> (class)' failed
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:3270: You
> forgot to call g_type_init()
>
> (process:3431): glibmm-WARNING **:
> Glib::ConstructParams::ConstructParams(): object class
> "(null)" has no property named "label"
>
> (process:3431): GLib-GObject-CRITICAL **: g_type_class_unref:
> assertion `g_class != NULL' failed
>
> (process:3431): GLib-GObject-CRITICAL **: g_object_newv:
> assertion `G_TYPE_IS_OBJECT (object_type)' failed
>
> (process:3431): GLib-GObject-CRITICAL **: gtype.c:2706: You
> forgot to call g_type_init()
>
> (process:3431): glibmm-CRITICAL **:
> Glib::Interface::Interface(const Glib::Interface_Class&):
> assertion `gobject_ != 0' failed
> (gdb)
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]