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

Sean McBride sean at rogue-research.com
Fri Nov 25 15:47:26 EST 2016


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




More information about the Insight-developers mailing list