dynamic_cast returns NULL but it shouldn't

后端 未结 1 558

I\'m having the following class hierarchy:

class IStorage {
    [...]
}
Q_DECLARE_INTERFACE(IStorage, \"ch.gorrion.smssender.IStorage/1.0\")


class ISQLiteS         


        
相关标签:
1条回答
  • 2021-01-19 02:46

    Basically, RTTI is unreliable across module boundaries. Different compilers have different behaviors here; you'll have to research how your compiler/version acts in this case. Of course, if you have a different compiler/version for the main app and plugin, it clearly has no chance of working.

    Use static_cast as a work around.

    0 讨论(0)
提交回复
热议问题