The situation is that I have a dynamic library written in C ++ that is wrapped for Python with another dynamic library also written in C ++ (generated by SIP to be specific). The first dynamic library defines a function do_raisethat throws an exception RaiserError, a subclass std::exception. The second dynamic library, in a wrapper do_raise, tries to catch RaiserErrorin order to translate it into a Python exception.
Building with Visual C ++, everything works as expected and is RaiserErrorcaught correctly. However, using g ++ on Linux is RaiserErrornot caught. If I try to catch std::exceptioninstead ( RaiserErrorbaseclass), it will work. What is wrong here? Do the two libraries have different type concepts RaiserErrorsince they are not recognized by the catch block?
For testing, I also write a small executable that calls do_raisein the C ++ library, and here I can catch RaiserErroreven with g ++.
Arve knudsen
source
share