I am created a new directory to contain some c++ code I am writing. However when I run the compiler on the .cc file in that directory it returns:
******:~/c++/helloworld$ g++ helloworld.cc -std=c++17 -o hello
/usr/bin/ld: cannot open output file hello: Permission denied
collect2: error: ld returned 1 exit status
I can however use the sudo command and the compiler then works. Any ideas on how to fix this?