I was attempting to compile C and C++ code using the default clang/clang++ and using the default gcc that is installed and it's no longer compiling. I have attached screenshots of what it looks like. I did find a workaround solution but it's not satisfactory. The workaround solution was to install a different version of gcc using brew (brew install gcc@13), and set them as environmental variables pointing to the path in ~/.zshrc, and those does work. The commands I set them to are $CC (for gcc-13) and $CXX (for g++-13). However, for clang, because apple couldn't verify the path, they are not allowing me to compile using it,
The following is the C++ code, I have also tried messing around with the extension (.cc vs .cpp) to see if it made some kind of difference. I have already tried approaches such as reinstalling xcode-select --install to reinstall the command line tools. This error arose when I attempted to add the bits/stdc++.h manually where the c++ installation is located (not fully sure but the compilers were able to compile correctly before this). The following is my code:And I have also attached screenshots of what happens if I try to compile them using the default compiler commands:Result of compiling using g++
Result of compiling using clang++:
Successful compiling using custom gcc version:
I have been searching for several hours to figure out a solution, I have attempted solutions such as reinstalling the xcode-select --install to reinstall my xcode command line tools, uninstalling and reinstalling gcc, based on what I found searching throguh google to no avail.
Information regarding my laptop:OS : macOS Sequoiachip : Apple M2 MacBook AirMemory : 24 GB
Additionally, there's these annoying errors that shouldn't be errors that I am getting: