c++ - iOS:更新到 Xcode 8.3 后编译器中的 C++ 警告

标签 c++ ios xcode compiler-warnings

我上周更新到 Xcode 8.3。我似乎无法摆脱这个编译器警告:

ld: warning: direct access in function 'std::__1::basic_filebuf<char, std::__1::char_traits<char> >::open(char const*, unsigned int)' from file '/Path/To/Derived/Data/Xcode/DerivedData/myapp/Build/Intermediates/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp_lto.o' to global weak symbol 'std::__1::basic_filebuf<char, std::__1::char_traits<char> >::open(char const*, unsigned int)' from file '/Path/To/Derived/Data/Xcode/DerivedData/myapp/Build/Intermediates/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp_lto.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

我已尝试解决此警告:

  1. 正在更改 Symbols Hidden by Default是 - 在所有目标中
  2. 正在更改 Symbols Hidden by Default否 - 在所有目标中
  3. 基本上一切here (虽然不完全相关)
  4. 清理/删除派生数据/等
  5. 已添加 -fvisibility=hidden到我的目标,以及所有 cocoapod 目标。 ( described here )

非常感谢任何见解。提前致谢。

2017 年 4 月 10 日更新:

这似乎是 NewRelicAgent 产生的问题。从我的项目中删除 cocoapod 消除了警告。进一步研究。

最佳答案

New Relic 支持的回应:

We reviewed these warning messages with our Mobile Engineering team. They advised these warnings are related to a difference introduced in Xcode 8.3 - which isn't applied to the latest version of the New Relic iOS Agent built in Xcode 8.2.

They also stressed that these warnings don't appear to have any negative effects - but please let us know if you notice any other issues.

It's likely this issue will be resolved in the next release of the agent, when it will be built with Xcode 8.3.

关于c++ - iOS:更新到 Xcode 8.3 后编译器中的 C++ 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43330276/

相关文章:

c++ - 在 C++ 中使用常量设置数组大小

c++ - C++ 中 vector push_back 操作的类型转换

ios - 如何防止在屏幕上通知用户有关 CloudKit 的新更改?

ios - Swift 3.0 和网络服务

SwiftUI如何防止 View 重新加载整个 body

ios - 访问字典数组的嵌套数组

objective-c - 将 NSString 转换为 NSDictionary/JSON

c++ - 用别名替换默认模板参数

c++ - 使用 shared_ptr 时内存泄漏

ios - Core Plot 散点图不可见,我做错了什么?