<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 14, 2016 at 6:36 PM, Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Mon, Nov 14, 2016 at 2:53 PM, Isaiah Norton <<a href="mailto:isaiah.norton@gmail.com">isaiah.norton@gmail.com</a>> wrote:<br>
> Hi Matt,<br>
><br>
>><br>
>> Here are the tests:<br>
>>   <a href="http://review.source.kitware.com/#/c/21755/" rel="noreferrer" target="_blank">http://review.source.kitware.<wbr>com/#/c/21755/</a><br>
>><br>
>> where reasonable export specification is added in both ITK and the<br>
>> client libraries. But, dynamic_cast fails on OSX:<br></span><br>
<br>
We will test further with Python wrapping for OSX with the<br>
ITKCommon_TEMPLATE_EXPORT approach, then investigate<br>
-fvisibility-ms-compat if that does not prove viable.<br></blockquote><div><br></div><div>To follow-up, after further investigation, we used the equivalent of ITKCommon_TEMPLATE_EXPORT but called it ITK_TEMPLATE_EXPORT so the same macro can be used across multiple modules. This macro is defined to __attribute__ ((visibility ("default"))) on OSX. As noted here [1], this is the same approach taken by libstdc++ for the templated STL containers:</div><div><br></div><div><div>"Part of the std:: (exceptions typeinfo symbols) must be visible-by-default</div><div>for proper throw-catch/dynamic_cast working across shared libs boundaries."</div></div><div><br></div><div>This is available in ITK 4.11.</div><div><br></div><div>Thanks,</div><div>Matt</div><div><br></div><div>[1] <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348</a><br></div></div></div></div>