Exceptions across binary boundary

前端 未结 5 1265
生来不讨喜
生来不讨喜 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 03:06

    IMHO, this as nothing to do with the compiler flags whatsoever.

    Declare your exception object as extern and don't provide any implementation anywhere except in your main binary.

    This will force the linker (dynamic linker BTW) to use the only implementation that's possible.

    No typeinfo is generated on extern definition only.

提交回复
热议问题