Nindi wrote:
Gianni Mariani wrote:
Nindi wrote:
Hi
>
I have a scenario with exceptions that I cannot explain.
>
I have an exception class 'MyException' derived from 'std::exception'
>
There are two libraries 'plugin' and 'framework' linked together by
loading at runtime.
>
The issue is that an exception of type 'MyException' is being thrown in
'plugin' and caught in 'framework', but some throws get caught by the
'MyExeption' handler and some some throws get caught by the
'std::exception' handler, in the same try-catch block.
>
Has anybody got any ideas what could possibly cause this to happen ?
>
I only get this problem when building with gcc on Linux, I do not have
this problem with msvc
The only real way of helping you is to show is the code. It could
possibly be a bug in gcc. What version of gcc are you using and are
framework and plugin build with the same compiler?
I would like to show code .. but I don't think I could rip that part of
code out an reproduce the errors. I am also looking at
http://gcc.gnu.org/wiki/Visibility , I 'think' my problem is detailed
there. I am using gcc 4.1
OK .. I fixed it , but I still don't know what was wrong. The header
file for 'MyException' contained the class implementation as well as
the class definition, This header file was being included in both
'plugin' and 'framework' .
I moved the implementation out into a seperate library and linked it
in.
Now its the 'MyException' Handler and not the ''std::exception'
handler that catches 'MyException' .