Add missing export to vsg::Exception struct#1680
Add missing export to vsg::Exception struct#1680rms7326 wants to merge 1 commit intovsg-dev:masterfrom
Conversation
If VulkanSceneGraph is compiled as a .dylib and used by another .dylib on the Mac where VulkanSceneGraph throws a vsg::Exception the client requesting the service from VulkanSceneGraph is not able to catch the vsg::Exception because the RTTI information is different. This is a known issue with clang. If the symbol is not exported for a shared library the RTTI information will not match that generated by dependent libraries for the same symbol.
|
Could there be issues under Windows with exporting a struct that is entirely defined in the header? |
|
It should be perfectly fine. |
|
This PR won't fix the bug, though, as I've run into (effectively) the same problem as this is trying to fix in the past, and it needs to be fixed by ensuring that the thing catching the exception and throwing it both export the symbol (whereas on Windows, you want the DLL to If that change is made, then as a follow-up task, we could add |
|
@AnyOldName3 this pull request isn't to fix a Windows issue but a AppleClang issue. An to be clear, by adding the @robertosfield, with regard to working with Windows, I believe your concern is address according to this MS compiler doc: |
Add missing export to vsg::Exception
Description
If VulkanSceneGraph is compiled as a .dylib and used by another .dylib on the Mac where VulkanSceneGraph throws a vsg::Exception the client requesting the service from VulkanSceneGraph is not able to catch the vsg::Exception because the RTTI information is different. This is a known issue with clang. If the symbol is not exported from a shared library the RTTI information will not match that generated by dependent libraries for the same symbol.
Type of change
Source change
Please delete options that are not relevant.
How Has This Been Tested?
Locally on our MacOS with arm64 architecture.
Test Configuration:
Checklist: