My iOS app uses a library which in turn depends on Boost. While revamping the 3rdparty build system, I encountered linker warnings such as this
ld: warning: direct access in ___cxx_global_var_init to global weak symbol
std::__1::basic_ofstream<char, std::__1::char_traits<char> >::~basic_ofstream()
means the weak symbol cannot be overridden at runtime.
This was likely caused by different translation units being compiled with different visibility settings.
and this
ld: warning: direct access in __GLOBAL__I_a to global weak symbol
boost::exception_ptr::~exception_ptr()
means the weak symbol cannot be overridden at runtime.
This was likely caused by different translation units being compiled with different visibility settings.
I saw that there are quite a few other questions on SO regarding this warning. I followed their advice and made sure that the visibility settings in all builds are the same (-fvisibility=hidden
and -fvisibility-inlines-hidden
). After a full rebuild I still got the warnings.
Environment:
- Xcode 4.6.0
- iOS SDK 6.1
- Building Boost using a modified clone of the popular galbraithjosephs-boostoniphone build script
- Boost version 1.54.0
- Building with
-std=c++11 -stdlib=libc++