xcode 6.4 中的链接器警告

Linker warnings in xcode 6.4

我为我的 ios 应用程序使用 C++ 库项目(使用 boost 1.57 库),当我构建我的应用程序时,我收到数百个链接器警告。该应用程序运行完全正常。

突出的警告是

ld: warning: direct access in boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>() to global weak symbol boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>()::ep means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

如何消除这些链接器警告?除了压制还有什么办法吗?

谢谢

我通过在 xcode 构建设置中将 "Symbols hidden by default" 更改为 "YES" 并将 "Inline Methods Hidden" 更改为 "YES" 来消除这些链接器警告。

iOS 的提升库是使用 -fvisibility=hidden -fvisibility-inlines-hidden 标志构建的,xcode 构建设置将符号可见性设置为 YES。因此存在不匹配和链接器警告。