xcode 构建错误 - 目标操作系统版本不支持使用线程局部变量
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52282646/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Build error - targeted OS version does not support use of thread local variables
提问by Swapnil Jain
What does the below error means? I've never seen this before.
下面的错误是什么意思?我以前从未见过这个。
d: targeted OS version does not support use of thread local variables in __ZN12base_logging10LogMessage5FlushEv for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
d:目标操作系统版本不支持在 __ZN12base_logging10LogMessage5FlushEv 中为架构 x86_64 clang 使用线程局部变量:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
I'm using cocoapod for google cast sdk and building in Xcode 10 beta and xcode 9.4.
我正在将 cocoapod 用于 google cast sdk 并在 Xcode 10 beta 和 xcode 9.4 中构建。
回答by Nikolai Ruhe
Your project tries to link some C++ code which makes use of a C++11 concept not supported all iOS platforms.
您的项目尝试链接一些 C++ 代码,这些代码使用了并非所有 iOS 平台都支持的 C++11 概念。
I think thread_local
is allowed beginning with iOS 9. Try to set the deployment target to iOS 9 or later.
我认为thread_local
从 iOS 9 开始是允许的。尝试将部署目标设置为 iOS 9 或更高版本。
The offending code is in base_logging::LogMessage::Flush()
.
违规代码在base_logging::LogMessage::Flush()
.
回答by ishab acharya
Changing the deployment target to 9.0 worked for me
将部署目标更改为 9.0 对我有用
open xcode:
打开xcode:
- select YOUR_PROJECT_NAME from target
- change Deployment target to 9.0 or greater under Deployment Info tab.
- 从目标中选择 YOUR_PROJECT_NAME
- 在部署信息选项卡下将部署目标更改为 9.0 或更高版本。
Hope it helps !
希望能帮助到你 !
Edit: For visual/image reference here
编辑:此处的视觉/图像参考