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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:45:44  来源:igfitidea点击:

Build error - targeted OS version does not support use of thread local variables

iosobjective-cxcodecocoapodsgoogle-cast-sdk

提问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_localis 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:

  1. select YOUR_PROJECT_NAME from target
  2. change Deployment target to 9.0 or greater under Deployment Info tab.
  1. 从目标中选择 YOUR_PROJECT_NAME
  2. 在部署信息选项卡下将部署目标更改为 9.0 或更高版本。

Hope it helps !

希望能帮助到你 !

Edit: For visual/image reference here

编辑:此处的视觉/图像参考

回答by Sheetal Shinde

enter image description here

在此处输入图片说明

Please change deployment target to 9.0 as shown in the image.

如镜像所显示,请将部署目标更改为 9.0。