在开始编译时,控制台返回:
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)这个文件被定制过,把里面的内容清理了一下。
解决收工