"Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." when using GCC

coachcal picture coachcal · Oct 4, 2014 · Viewed 203.2k times · Source

While attempting to compile my C program, running the following command:

gcc pthread.c -o pthread

Returns:

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

and my code does not compile.

Why is this happening and how can I fix this problem?

Answer

coachcal picture coachcal · Oct 4, 2014

Open up Xcode, and accept the new user agreement. This was happening because a new version of Xcode was downloaded and the new agreement was not accepted.