After a most recent software update on my mac, I'm not able to compile and link a c++ hello world program without sudo.
The program (helloworld.cpp):
std::cout << "hello world\n";
ld: can't write output file: a.out for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
sudo clang++ helloworld.cpp
You must be sitting in a directory which is not writable by your user. Look at
ls -ld . to see where you are and what the permissions are there. Try also creating an empty file by
touch foo.txt in the same directory where you ran Clang.