GCC 4.5.2 Linker gots Problem while using Exceptions (C++)

后端 未结 2 967
面向向阳花
面向向阳花 2020-12-21 18:30

I try to write a webserver. As far as I am, it works quiet good with Windows. But I want to make it also Unix compatible. And I think there has to be a problem with the here

相关标签:
2条回答
  • 2020-12-21 19:25

    Judging from undefined reference to __gxx_personality_v0 linker message it looks like you are linking with gcc. You need to link C++ applications with g++. Or link with gcc and add -lstdc++ to the linker command line.

    0 讨论(0)
  • 2020-12-21 19:25

    You aren't showing the relevant code and compiler invocation, but know that std::exception has an unimplemented virtual member function what() that you're expected to override, so don't go throwing naked std::exceptions if you want to callwhat().

    Any of the derived, specific exceptions in <stdexcept> will implement what() and allow you to store a message when you're constructing the exception object.

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