You need to enable JavaScript to run this app. MacOS 10.15 SDK编译报LibcOverlayShims.h errno未声明错误,归档后Debug异常
优惠活动
大模型
产品
解决方案
定价
更多

MacOS 10.15 SDK编译报LibcOverlayShims.h errno未声明错误,归档后Debug异常

归档时触发的Swift SDK层编译错误

具体报错信息

编译过程中抛出SDK本身的编译错误,控制台输出如下:

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "LibcOverlayShims.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/shims/LibcOverlayShims.h:66:10: error: use of undeclared identifier 'errno'
  return errno;
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "LibcOverlayShims.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/shims/LibcOverlayShims.h:70:3: error: use of undeclared identifier 'errno'
  errno = value;
  ^
<unknown>:0: error: could not build Objective-C module 'SwiftOverlayShims'

已开展的排查操作

  • 最初根据报错怀疑errno.h未被引入,经确认LibcOverlayShims.h第33行已主动引入该头文件,排除头文件漏引的可能性
  • 执行常规构建排查操作:删除DerivedData、清理构建产物、重装Xcode、重启设备,问题未得到解决
  • 拆分项目应用代码逐段定位问题来源,未找到明确触发点

复现规律与特性

  • Debug构建模式下运行完全正常,仅执行应用归档操作时会触发上述报错
  • 异常扩散特性:归档触发报错后,即使切回Debug构建模式,编译也会失败,常规清理操作无法消除该影响
  • 临时恢复方式:随机修改项目文件后执行git reset --hard回滚,Debug构建即可恢复正常,但只要再次执行归档操作,问题就会复现
  • 初步判断:Release构建配置存在异常,且归档过程生成的异常缓存构建状态会影响后续Debug构建,常规清理无法清除该缓存

内容的提问来源于stack exchange,提问作者Alex

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.22 04:15:08