If you are still experiencing errors when you compile. Go to the terminal and run the following commands:
ls /usr/lib/c++/v1/ | grep '.*std.*'
ls /usr/include/c++/4.2.1/ | grep '.*std.*'
ls /usr/include/ | grep '.*std.*'
finally run this command
g++ -v
What output do you get for each?