>>311
alias g++='/usr/local/bin/g++'
としてg++ -vとするとうまくいきました。また、g++を使ったコンパイルもうまくいきました。しかし、コンパイルされたファイルを実行しようとすると
./a.out: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
というエラーが出て実行できません。何がいけないのでしょうか。libstdc++.so.6が存在しないというのはわかるのですが、解決方法がわかりません。