[Interest] qobject_cast

Igor Mironchik igor.mironchik at gmail.com
Thu Apr 20 18:32:40 CEST 2017

20.04.2017 19:16, Thiago Macieira пишет:
> On quinta-feira, 20 de abril de 2017 08:47:46 PDT Igor Mironchik wrote:
>>> Fix it by adding a non-inline virtual destructor to Channel.
>> Sure. It's just a pseudo code.
> Then stop pasting pseudo-code. If you hide the problem, then you won't *see*
> the problem.

Ok. I'm sorry.

>> In real code was virtual destructor and dynamic_cast and static_cast
>> worked, but qobject_cast failed.
>> The reason was in static linking of Channel to the application and to
>> the plugin.
> You violated One Definition Rule of C++. Your application has Undefined
> Behaviour. You caused this, you pay the price.
> Stop violating ODR and it will work.

Yes, it's so.

More information about the Interest mailing list