I have had this problem for months and finally found a solution for my Eclipse. I noticed that this problem appeared in some of my projects but not in all of them, and after checking the .cproject options I realized that somehow Eclipse is using some variables that are either not defined or not expanded properly, in my case ${CXX} and ${CC}.
So my solution is to go to Preferences > Run/Debug > String Substitution and create two string substitution variables:
- CC=gcc
- CXX=g++
Clean the errors from the console, restart Eclipse and the errors are gone.
Hope that helps.