Suppose you are developing a library with classes to be exported through a DLL (on Windows, or similar shared-library like Linux ELF shared libs). Member functions on those classes throw exceptions either from the standard library or library defined exceptions.
It is totally safe to code in DLLs to throw exceptions to the modules that map the address space of the DLL? What are the considerations to be taken when developing software components in shared libs from where exceptions are thrown to client modules?
Thank you very much.
I would agree that it’s perfectly reasonable to expect exceptions thrown across library boundaries to work fine. However, don’t be too surprised if you run into a few glitches. A Google search for ‘gcc shared object exceptions’ (check out groups too) shows a lot of people having a lot of problems over the years. The last time I tried it with gcc (ca 2003), I gave up because it just didn’t work for me. Hopefully, things have improved since then.