After upgrading macOS to 12.6, I was unable to use
g++ -v. When I run
g++ -v in the command line, it repeatedly asked me to install command line tools. I tried to run
xcode-select --install, but the option
--install seemed to be wrong.
Later I found that the following command worked:
1 sudo xcode-select -switch /Library/Developer/CommandLineTools