[ITK-dev] -fvisibility=hidden link warnings with GetMetaDataObjectTypeName()

Matt McCormick matt.mccormick at kitware.com
Tue Nov 29 15:53:46 EST 2016


On Mon, Nov 28, 2016 at 12:14 PM, Isaiah Norton <isaiah.norton at gmail.com> wrote:
>> It sorta reminds me of the 'dynamic_cast on Mac OSX' thread, is it
>> related?
>
>
> Yes. This is a symptom of the same issue: missing export annotations. Hans
> emailed about the same warnings in April (the mailing list archive is
> currently down so I can't provide a link, but I can find it in my gmail
> folder for insight-dev with a search for "global weak symbol").

This patch:

  http://review.source.kitware.com/#/c/21805/2/Modules/Core/Common/include/itkArray.h

will address the issue.



>
> On Fri, Nov 25, 2016 at 3:47 PM, Sean McBride <sean at rogue-research.com>
> wrote:
>>
>> Hi all,
>>
>> I'm trying to rebuild my app and all its C++ libraries with
>> -fvisibility=hidden -fvisibility-inlines-hidden.  It all builds, but I get 3
>> very similar link warnings building my app; the first is:
>>
>> ld: warning: direct access in function
>> 'itk::MetaDataObject<itk::Array<double> >::GetMetaDataObjectTypeName()
>> const' from file 'libITKCommon.a(itkMetaDataObject.cxx.o)' to global weak
>> symbol 'typeinfo for itk::Array<double>' from file 'MyOwnCode.o' means the
>> weak symbol cannot be overridden at runtime. This was likely caused by
>> different translation units being compiled with different visibility
>> settings.
>>
>> I'm using ITK 4.10.1 on OS X 10.11.6 with Xcode 7.3.1 (AppleClang 7.3).
>>
>> I'm hoping one of you C++ wizards could help me decipher the problem.  :)
>> It sorta reminds me of the 'dynamic_cast on Mac OSX' thread, is it related?
>>
>> Thanks,
>>
>> --
>> ____________________________________________________________
>> Sean McBride, B. Eng                 sean at rogue-research.com
>> Rogue Research                        www.rogue-research.com
>> Mac Software Developer              Montréal, Québec, Canada
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-developers
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list