在開始編譯時,控制台返回:
error: linking with `cc` failed: exit status: 1 中間文本是海量的報錯 = note: ld: library 'System' not found clang: error: linker command failed with exit code 1 (use -v to see invocation)
網上有一大堆解決方法,比如重裝rustrover, 重新安裝commandline-tools, 沒一個有用
解決記錄
發現報錯文字裡有大量的Python字樣,隨手刪了homebrew安裝的python 3.12,安裝commandline-tools
brew cleanup brew uninstall python --ignore-dependencies
如果你動過commandline-tools,得刪了重裝一下
sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --reset sudo rm -rf ~/Library/Developer/Xcode xcode-select --install
重要的步驟是,我的mac用戶下的.zshrc(路徑是~/.zshrc)這個文档被定制過,把裡面的内容清理了一下。
解決收工