Re: gtkmm2.4 and MSVC (again)



This is strangely similar to a dynamic_cast<> problem that existed in g++
2.96:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/FAQ/html/index.html#id2543380

So it might be a compiler bug with use of dynamic_cast<> in the
constructor of with classes that use multiple inheritance. But to reach
that conclusion we would need a non-gtkmm test case.

In the meantime, please make sure that any extra project file changes are
in our CVS, so that we are starting at the same point. I have access to
MSVC++ .Net 2003, so I might take a look if your own efforts don't reach a
conclusion.

> i'm finding more details (slowly).
> the problem is the casting from the Glib::ObjectBase
> to the Gtk::Widget (or others).
> here's another test that gives the exact same results.
>
> class A : public Gtk::Window {
>
>    A():Gtk::Window(TOPLEVEL){
>       Gtk::Window * w1 = this;
>       Glib::ObjectBase * obj =
> dynamic_cast<Glib::ObjectBase *>(w1);//this line works
> fine
>       Gtk::Window * w2 = dynamic_cast<Gtk::Window
> *>(obj); //this gives the _non_rtti_object exception
>    }
>
>    ~A();
>
>
> };
>
> class B : public A {
>
>    B():A(){}
>    int i;//commenting this eliminates the exception
> };
>
> if we can figure out why this is happening, it'll fix
> the problem.
> i tried changing what class A extends (Gtk::Widget,
> Gtk::Object, etc) just to see if i can cast back and
> forth.  the same results.  (i'm not sure, but i think
> when i made class A extend Glib::Object the casting
> worked).
> i do get warnings in compiling that says Gtk::Window,
> Bin, Container, and Widget inherit set_manage() and
> destroy_notify_() by dominance.  i'm not sure if this
> could be the problem.
>
> any ideas?
> thanks for all your help!
> --Matt
>
> --- Roger Leigh <rleigh whinlatter ukfsn org> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Cedric Gustin <cedric gustin swing be> writes:
>>
>> > class MyHelloWorld : public HelloWorld
>> > {
>> > public:
>> > 	MyHelloWorld() {}
>>
>> Does
>>         MyHelloWorld(): HelloWorld() {}
>> change anything?
>>
>> It might just be you didn't chain up to the base
>> class constructor?
>>
>> > 	virtual ~MyHelloWorld() {}
>> >
>> > private:
>> > 	int i;  // comment this out and helloworld does
>> not crash !
>> > };
>>
>>
>> - --
>> Roger Leigh
>>                 Printing on GNU/Linux?
>> http://gimp-print.sourceforge.net/
>>                 Debian GNU/Linux
>> http://www.debian.org/
>>                 GPG Public Key: 0x25BFB848.  Please
>> sign and encrypt your mail.
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.2.5 (GNU/Linux)
>> Comment: Processed by Mailcrypt 3.5.8
>> <http://mailcrypt.sourceforge.net/>
>>
>>
> iD8DBQFBhqibVcFcaSW/uEgRAm+QAJkB0Cpk20kRSlXNTfRlbDEFfUZ/vgCgoVZ9
>> p0ehPxF9Cu87c7tfakvKh3k=
>> =2ymi
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> gtkmm-list mailing list
>> gtkmm-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>


Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]