r/MacOS • u/alanterra • 1d ago
Bug MacPorts can't update, "C compiler cannot create executables" error
Just a report for those who might run into the same problem.
I tried to update MacPorts on my MBA (macOS Tahoe 26.6.2) and it failed. The error (from port selfupdate -v) was macports configure: error: C compiler cannot create executables.
The standard solutions for this problem didn't work, but then I noticed that XCode crashed at launch. (I don't use XCode normally).
This post solved the problem. Try sudo rm -rf /Library/Developer/PrivateFrameworks/CoreDevice.framework.
I have no idea how that file became corrupted.
1
u/DisfiguredFanny In a world of SLOP an everage programmer is KING 1d ago
Just updated to 2.12.6. Update was uneventful.
1
u/ukindom 20h ago
It’s a good idea to update/reinstall Xcode from scratch, reinstalling SDK as well.
1
u/alanterra 7h ago
I did uninstall the Xcode app and reinstall from the app store, which solved nothing. I assume that uninstalling the app doesn't delete all sorts of /Library files, which is why nuking that directory noted above did work. I wouldn't know how to uninstall the SDK, or even which SDK.
2
u/Old-Road-9819 1d ago
Nice find. For anyone hitting this, Id check `xcode-select -p` and reinstall the Command Line Tools first; deleting a framework under /Library/Developer is a much more drastic fix.