Eclipse CDT: Unresolved inclusion of stl header
This allowed me to avoid Eclipse "Unresolved inclusion" error.
In my case I had to find the location of the C++ vector header on my computer (which is a Mac):
find /usr/local -name vector -print
I found the correct include location in folder "/usr/include/c++/4.2.1". Then I set my project eclipse settings like so:
Project->Properties->C/C++ General->Paths and Symbols->GNU C++->(Add)->"/usr/include/c++/4.2.1"
I'm not using C++ Builder, but my solution might address part of your trouble.
Eclipse CDT indexer - how to solve unresolved includes
Ok, so I've now fixed this issue.
Unresolved includes from other projects in the workspace and third-party libraries was solved by adding the other projects as references. I guess the compiler knew where to look because I'd added the locations to the Includes list, but the indexer didn't (possibly due to eclipse only processing headers once?)
Unresolved includes from STL I fixed by changing all my .c files that were actually C++ to .cpp. Just changing the compile command to 'g++' obviously wasn't enough to tell the indexer to treat the project as C++.
In the case of 1), I needed to clean/rebuild index of the referenced projects first to remove the unresolved include errors.
string could not resolved error in Eclipse for C++ (Eclipse can't resolve standard library)
The problem was that I needed to have both minGW and MSYS installed and added to PATH.
The problem is now fixed.
Eclipse CDT flags extern C in header file as syntax error
I got a reply to my bug.
The root cause apparently is that I originally generated the Eclipse project files from CMake using
cmake -G "Eclipse CDT4 - Unix Makefiles" ~/src/foobar
This functionality appears to be unmaintained and has caused lots of trouble in the past. Upon their recommendation, I tried installing cmake4eclipse (available on Eclipse Marketplace) and importing the project from scratch.
(If you reuse the same workspace and maintain the project name, even your build configurations are preserved—you may just need to update the paths.)
Moving to cmake4eclipse also eliminates a few other limitations of the previous setup and seems to fix another error with C files dropping out of the index over and over.
Related Topics
How to Use an Enum Value in a Switch Statement in C++
Unit Testing of Private Methods
Idiomatic Way to Declare C++ Immutable Classes
How to Construct an Iso 8601 Datetime in C++
What Does the "L" Mean at the End of an Integer Literal
Windows & C++: Extern & _Declspec(Dllimport)
Version 'Cxxabi_1.3.8' Not Found (Required by ...)
C++ Standard Practice: Virtual Interface Classes VS. Templates
What Should Be the Sizeof(Int) on a 64-Bit MAChine
Disabling G++'s Return-Value Optimisation
What Is the Performance Impact of Using Int64_T Instead of Int32_T on 32-Bit Systems
How to Initialize and Print a Std::Wstring
Incompatible with Parameter of Type "Lpcwstr"
How to Validate That a String Is a Valid Ipv4 Address in C++
Templates: Template Function Not Playing Well with Class's Template Member Function