1

几天来,无论何时gcc或被go调用,系统都会抛出以下警告(macOS High Sierra 10.13.5):

ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking

我感觉某些go软件包 的安装go get可能更改了上述目录中的某些文件,但我无法验证这一点。

有没有办法正确确定消息的原因?

4

1 回答 1

1

make几个星期以来,我一直在看到这些警告从我的流程中喷涌而出。我最近制作了一个 Xcode 项目来构建使用make(通过外部构建系统make项目),并注意到从 Xcode 运行时不存在这些警告。唯一的区别是 Xcode 在运行之前导出了一系列构建设置环境变量make

经过一些实验,结果证明这是一个SDKROOT变量,事后看来,这是完全合理的。我将此变量添加到我的 makefile 中,警告消失了:

export SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk

注意:该路径可能会随着 Xcode 的不同版本而改变。改为参考当前的 SDK 版本可能是明智的:

export SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

当然,假设您安装了 Xcode。

于 2019-03-01T20:00:19.890 回答