clang compiler not working on my terminal

I just upgraded to El Capitan and found out that the C compiler (Clang) is not working under the command line. I wrote a "hello word" test, tried to compile and I get the following error:


$ cc test.c -o test


error: unable to open output file

'/var/folders/Ge/GeRStfi8Ek8jojLcqf1vsE+++TI/-Tmp-/test-ad7039.o': 'No

such file or directory'

1 error generated.


... do I have a permission problems somewhere? Thanks!

It is indeed a permission problem as I can actually compile the file using sudo; I tried repairing manually the permissions using the command line with:


sudo /usr/libexec/repair_packages --verify --standard-pkgs /


and


sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /


but still I cannot compile without the sudo command

Well, that’s weird. If I were in your situation I’d debug this as follows:

  1. start up a VM running 10.11

  2. run my test in the VM to verify that things work there

  3. for each directory in the error path, compare the permissions in the VM against the permissions on my Mac

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
clang compiler not working on my terminal
 
 
Q