Try-catch doesn't work in shared library?

前端 未结 2 1717
太阳男子
太阳男子 2021-02-06 13:23

(This is like my other question but this one is for another thing, even if it\'s related)

I\'ve got a big issue in my project. I\'ve got a library which handl

2条回答
  •  花落未央
    2021-02-06 14:03

    Simple. Never use ld with C++. I changed all ld commands in my project to g++ but seems I forgot for this library.

    In short, I was using ld for building my library but g++ for the main executable. So the exceptions worked in the executable but not in the library because ld does not includes the C++ libraries which handle the exception system.

提交回复
热议问题