I had the same problem and patches mentioned above didn't help
After few hours of searching an error I have made something that solved problem.
I've seen that in my system program cc is a symlink to program g++. Change it so to point on GCC. I think it should help