I've created a C++ project that compiles fine and also runs without a problem. A few days ago I reinstalled my OpenSuse but kept my workspace to use it with my new installation. So after installation of OpenSuse I downloaded Eclipse and CDT and opened my already existing workspace. My C++ project again runs without a problem but the curious thing is that Eclipse shows bugs in my project although there are no bugs present. To be more precise Eclipse shows two types of bugs: "Type x could not be resolved" and "Invalid arguments Candidates are .."
Is that a bug of CDT?
These error messages are from the static code analyzer CODAN. I guess the index of your project is not correct due to the reinstallation (and CODAN relies on this index). Rebuild your index (Context menu of Project: Index->Rebuild).
Dmitry Egorov Messages: 11 Registered: July 2009 Location: Moscow
Junior Member
Hi, all!
I create the Linux Kernel Module project follow by this link:http://www.on5di.com/~noel/eclipse/kernelmodules.html
and have the same problems (Eclipse shows two types of bugs: "Type x could not be resolved" and "Invalid arguments Candidates are ..").
It not fixed by 'Index->Rebuild'
I create C and C++ projects, both has fake errors (my kernel module and exe file for testing produced correctly by make&gcc).
Appreciate any suggestions.
Eclipse shows two types of bugs: "Type x could not be resolved" and "Invalid arguments Candidates are .."
These messages are from Codan (static analysis) they are not related to compilation errors. Static analysis in CDT is far from perfect and produces false problems, so you can: ignore such false problems, turn off static analysis for project/particular files.
I found two cases where I was getting incorrect CODAN errors.
1. if i use this syntax to declare a method:
void myfunc( myClass & classArg );
if i take out one of the spaces either side of the '&' errors go away
2. include files not found:
if CODAN says a reference in a headr file cannot be found, when it is found by
the compiler, i just include that header specifically in the offending file.