I am using eclipse in linux to develop a c++ application and I am getting this editor annotation error \"Symbol \'vector\' could not be resolved\" from the following code
I had the same issue. I believe the problem arises from how std:: autocompletion is updated. Eclipse should be getting this from the Path and Symbols, but it could be buggy. I had to clean all Eclipse settings after upgrading gcc (thus, g++), since you're in Linux it's under your home folder ~/.eclipse/.
Thus,
1) Re-started Eclipse after cleaning ~/.eclipse/.
2) checked that Path and Symbols (under right-click on project > General > Path and Symbols) included all the upgraded gcc and c++ include directories (vector should be under ./gcc/version/include/c++/version/)
3) Rebuild index.
4) Created a *.cpp file that includes the *.h where the error is showing. This will force Eclipse to backtrace dependencies for *.h.
5) Rebuild index and/or restart a few times as required, now I can see vector at the end of std:: autocompletion.
(see picture)
Hope it helps!