error , Symbol 'vector' could not be resolved

后端 未结 12 836
心在旅途
心在旅途 2021-01-04 00:34

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

12条回答
  •  孤街浪徒
    2021-01-04 00:58

    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.

提交回复
热议问题