Exceptions across binary boundary

前端 未结 5 1270
生来不讨喜
生来不讨喜 2021-02-07 02:06

I know, this question has been asked quite some times, however I can\'t find a solution for my problem.

I have the following situation:

   A
  / \\
 /            


        
5条回答
  •  星月不相逢
    2021-02-07 02:47

    I had similar problems with gcc < 4.5 with RTTI symbols used across shared library boundaries, but not with gcc 4.6. However, you might still find the following information useful.

    As already mentioned, the vtable (containing an entry to the typeinfo object) for EException seems to be duplicated in some translation units which was definitely a problem with gcc < 4.5 (well, it is an issue of libsupc++, as far as I know, not merging the type_info objects). Anchoring the vtable of EException by defining a virtual out-of-line destructor (it must be the first virtual function declaration in the header) in A did the trick for me.

    Posting the complete header file for EException might also be helpful.

提交回复
热议问题