首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Xcode 9模块循环依赖关系:达尔文-> std ->达尔文

Xcode 9模块循环依赖关系:达尔文-> std ->达尔文
EN

Stack Overflow用户
提问于 2017-09-18 05:00:57
回答 1查看 1.9K关注 0票数 1

自从在Xcode 9(以前的8.2)中打开我的项目以来,有几个静态库和框架目标由于大量错误而无法编译。此循环依赖关系错误始终位于顶部。

一个例子是libzip的静态库目标。问题来自于这个单一的#,包括系统的zlib库:

代码语言:javascript
复制
#include <zlib.h>

大多数目标都可以通过禁用具有构建设置的启用模块(C和Objective)的模块来解决这一问题。

我有一个Swift/C框架,它定义了几个模块,这不是一个解决方案。

许多错误都与tgmath.h有关,它因对模块玩得不好而臭名昭著。我不知道为什么包含tg计量--它在达尔文模块地图中是显式的。我很想检查一下<module-includes>:28,但我不知道怎么做。

下面是编译错误的一个示例。有人知道如何在Xcode 9中修复这个问题吗?

代码语言:javascript
复制
While building module 'zlib' imported from /Users/.../lib/zipint.h:40:
While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stddef.h:46:
While building module 'std' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/tgmath.h:31:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctype.h:39:15: fatal error: cyclic dependency in module 'Darwin': Darwin -> std -> Darwin
#include_next <ctype.h>
              ^
1 error generated.
While building module 'zlib' imported from /Users/.../lib/zipint.h:40:
While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stddef.h:46:
In file included from <module-includes>:28:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/tgmath.h:37:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/tgmath.h:31:10: fatal error: could not build module 'std'
#include <complex.h>
 ~~~~~~~~^
2 errors generated.
While building module 'zlib' imported from /Users/.../lib/zipint.h:40:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/zlib.h:34:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/zconf.h:247:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stddef.h:46:15: fatal error: could not build module 'Darwin'
#include_next <stddef.h>
 ~~~~~~~~~~~~~^
3 errors generated.
In file included from /Users/.../lib/zip_get_compression_implementation.c:36:
/Users/.../lib/zipint.h:40:10: fatal error: could not build module 'zlib'
#include <zlib.h>
 ~~~~~~~~^
4 errors generated.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-18 06:16:19

最后,问题是遗留的自定义头搜索路径。它对SDK,XcodeDefault.xctoolchain/usr/include/c++/v1有一个明确的引用。在搜索路径中包含这些头会破坏依赖周期保护。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46271892

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档