执行make命令编译curl-7.73.0时遇权限拒绝错误求助
Hey there, let's fix that permission error you're hitting when compiling curl 7.73.0 on your iMac. The error clearly shows your user account doesn't have write access to the .libs directory or the files inside it—here are some straightforward fixes to get you back on track:
Fix directory ownership first
Chances are the curl source directory or some files inside it are owned by root (maybe you usedsudoto extract or clone the code earlier). Run this command to take full ownership of the entire source tree:sudo chown -R $(whoami):staff /path/to/your/curl-7.73.0Replace
/path/to/your/curl-7.73.0with the actual path to your curl folder (e.g.,~/Downloads/curl-7.73.0if it's in your Downloads folder).Clean up leftover build files
Previous failed compile attempts might have left behind files with wonky permissions. Start by cleaning the build artifacts:make cleanIf even
make cleanthrows a permission error, usesudoto force it:sudo make cleanOnce cleaned, re-run your configure script (if you haven't already) and compile again as your regular user:
./configure makeAvoid using
sudo makeunless absolutely necessary
Compiling withsudowill make all build files owned by root, which will just cause more permission headaches later. If you must usesudoto get past a block, remember to fix the ownership afterward:sudo make sudo chown -R $(whoami):staff /path/to/your/curl-7.73.0Check if SIP is restricting your build directory
macOS System Integrity Protection (SIP) blocks write access to certain system directories. If you're trying to compile curl in a system folder (like/usror/System), move the source code to a user-owned directory instead—like~/Documentsor~/Projects. This should bypass any SIP-related restrictions.
内容的提问来源于stack exchange,提问作者IosAdvocate

