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 feel that some library is missing or the paths are not set.
Yes, this sounds like a linker error. Linkers deal with symbols.
I explicitly downloaded STL but its of no use.
Hopefully you mean libstdc++, GNU's implementation of the C++ Standard Library, and you probably shouldn't have done this. Your toolchain comes with the proper stdlib implementation.
Do I have to re install GCC on my linux?
Probably wise. And let this installation handle the standard library.
Also, on the off-chance that you're playing with your compilation command line, remember to invoke g++
not gcc
; g++
automatically links in the C++ runtimes and stdlib implementation, whereas gcc
is designed for C.