我正在嘗試運行一個簡單的 go 代碼package mainimport ( "log" "net/http" "fmt")func homePage(w http.ResponseWriter, r *http.Request) {}func handleRequest() { http.HandleFunc("/", homePage) log.Fatal(http.ListenAndServe(":8081", nil))}func main() { handleRequest()}Go 版本:go1.17.5 darwin/arm64macOS:蒙特雷 12.1錯誤信息:# runtime/cgold: unsupported tapi file type '!tapi-tbd' in YAML file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture arm64clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
1 回答

紫衣仙女
TA貢獻1839條經驗 獲得超15個贊
以下命令幫助了我。
嘗試重新安裝 Xcode 命令行工具并升級 llvm 和 gcc。
$ brew upgrade llvm
$ brew upgrade gcc
$ sudo rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
- 1 回答
- 0 關注
- 194 瀏覽
添加回答
舉報
0/150
提交
取消