Use of private header from outside its module: ‘netinet6/in6.h‘该错误提示 “Use of private header from outside its module: ‘netinet6/in6.h’” 表示在代码中直接导入了 Xcode 不允许外部模块使用的私有头文件 netinet6/in6.h。 原因分析 netinet6/in6.h 是一个 私有头文件,属于系统底层网络实现细节,不对外公开。 从较新版本的 Xcode(如 Xcode 15+)开始,Apple 加强了模块化和 API 封装,禁止直接导入私有头文件,以提升系统稳定性和安全性