error , Symbol 'vector' could not be resolved

后端 未结 12 922
心在旅途
心在旅途 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 01:17

    Most likely you have some system-specific include directories missing in your settings which makes it impossible for indexer to correctly parse iostream, thus the errors. Selecting Index -> Search For Unresolved Includes in the context menu of the project will give you the list of unresolved includes which you can search in /usr/include and add containing directories to C++ Include Paths and Symbols in Project Properties.

    On my system I had to add /usr/include/c++/4.6/x86_64-linux-gnu for bits/c++config.h to be resolved and a few more directories.

    Don't forget to rebuild the index (Index -> Rebuild) after adding include directories.

提交回复
热议问题