Cannot run g++ compiler on a new director

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++ -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?

I’ve moved this to the category because this site isn’t designed to take tech support questions. Sorry. I’d recommend using one of the official support channels listed on the page.