title: Troubleshooting clang error to get C++ code in CLion to work
body: <p>I'm an inexperienced programmer so bear with me if this little sense. I'm trying to run a basic "hello world" kind of program in CLion, except I'm trying to print out a value in the main.cpp file from a header and cpp file. I'm using MacOS and everything is update in terms of software. When I try to build or run the program, it gives me these errors:</p>
  
  <pre><code>====================[ Build | untitled1 | Debug ]===============================
  /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/anshuldaga/untitled1/cmake-build-debug --target untitled1 -- -j 2
  [ 33%] Building CXX object CMakeFiles/untitled1.dir/main.cpp.o
  [ 66%] Building CXX object CMakeFiles/untitled1.dir/test.cpp.o
  make[3]: /Library/Developer/CommandLineTools/usr/bin/c++: Permission denied
  make[3]: /Library/Developer/CommandLineTools/usr/bin/c++: Permission denied
  make[3]: *** [CMakeFiles/untitled1.dir/main.cpp.o] Error 1
  make[3]: *** Waiting for unfinished jobs....
  make[3]: *** [CMakeFiles/untitled1.dir/test.cpp.o] Error 1
  make[2]: *** [CMakeFiles/untitled1.dir/all] Error 2
  make[1]: *** [CMakeFiles/untitled1.dir/rule] Error 2
  make: *** [untitled1] Error 2
  </code></pre>
  
  <p>I've already tried running the sudo g++ main.cpp command and it gives me this error:
  clang: error: linker command failed with exit code 1 (use -v to see invocation)</p>
  
  <p>Based off my research, I know that clang is the compiler for c++ and a linker error is basically when something can't find the right files or library.</p>
  
  <p>I've uninstalled and reinstalled Xcode, did the </p>
  
  <pre><code>sudo xcode-select -switch /Library/Developer/CommandLineTools/
  </code></pre>
  
  <p>command. I'm not sure what to do at this point. Any help would be greatly appreciated, thank you!</p>