登录
首页 >  Golang >  Go问答

无法启动golang调试,显示缺少CoreFoundation框架

来源:stackoverflow

时间:2024-02-09 23:06:26 369浏览 收藏

本篇文章主要是结合我之前面试的各种经历和实战开发中遇到的问题解决经验整理的,希望这篇《无法启动golang调试,显示缺少CoreFoundation框架》对你有很大帮助!欢迎收藏,分享给更多的需要的朋友学习~

问题内容

我使用的是 macbook pro m1,在数据迁移或更新到 monterey 后(不确定是什么原因导致的),golang 似乎无法调试或 go list 编译。我尝试重新安装/更新golang,结果是一样的

go版本:1.17.3 darwin/arm64

开始调试时出现错误消息

build error: go build -o /var/folders/x8/s3w_s9rj0qj74hs68wvqs1740000gp/t/__debug_bin4251008076 -gcflags all=-n -l .
# runtime/cgo
ld: framework not found corefoundation
clang: error: linker command failed with exit code 1 (use -v to see invocation) (exit status 2)

go list 编译时出现错误消息

# runtime/cgo
ld: framework not found CoreFoundation
clang: error: linker command failed with exit code 1 (use -v to see invocation)
confcenter

我能做什么,有什么想法吗?


正确答案


您需要重新安装 commandlinetools。 xcode-select 表示一切都是最新的,但此信息似乎是错误的。

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

以上就是《无法启动golang调试,显示缺少CoreFoundation框架》的详细内容,更多关于的资料请关注golang学习网公众号!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>