There is a lot of posts about that and I have already tried to apply solutions that have worked for others, but still not for me.
First, everything was fine with a c++ project I am working on under Linux, with Eclipse Indigo, gcc-4.7.1, cx11 activated, and Gentoo Linux. My project uses a home built static library. I made some modifications regarding some template class declarations. Then, I had some unexpected ‘could not be resolved’ in my library.
What I did is to rebuild the index of the library, clean the project and rebuild it. It compiles fine like it already used to before the modifications and before the index rebuild, but the ‘could not be resolved’ is still here.
OK, I try to see at least if my main project builds. There is one unresolved name from the library. So I rebuild the main project index, and here, all standard keywords become underlined with a ‘could not be resolved’ everywhere, and no compilation possible since it finds thousands of unresolved names.
I tried to clean and rebuild, to add many include paths in the project properties :
-I/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/plugin/include -I/usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.1/include/g++-v4/algorithm -I/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/include -I/usr/include -I/usr/include/linux -I/usr/local/include
That has changed nothing.
The ‘index/Search for unresolved features’ finds :
algorithm, cassert, cmath, cstdlib, fstream, iostream, map, set, sstream, string, tuple, utility
I tryed to add explicitely the algorithm include path. But that has changed nothing.
At the beginning of my .cpp, I have a using namespace std;
. If I add std::
before for example set
, it changes nothing.
Autocompletion after std::
does not propose for example set
.
Of course, I have tried to close/reopen Eclipse, but without more success.
Any clues?
Advertisement
Answer
The .metadata
was corrupted. I simply replaced it by a backup.
Still, the origin of the problem remains unknown. As most .metadata
files are binary, I cannot investigate the issue any further.