Dubious error messages in Eclipse (CDT) while build succeeds
Using the Eclipse IDE for C/C++ Linux Developers (Version: Indigo Release) with g++ 4.1.2 (on Scientific Linux CERN 5 = RHEL 5), I currently work on a project where I make use of a Qt4 GUI as well as Apache's log4cxx framework and of some C++ standard classes. I have installed Nokia's "Qt Eclipse Integration for C++" plugin, which automatically configured Qt toolchain support (qmake, etc.).
Up until now I got everything running. My program compiles well. Except for some warnings (which are reasonable), I observe a successful build process on Eclipse's console. Unfortunatetly, at the same time I get about 150 error messages in the "Problems" window.
Some examples:
For the line
using namespace log4cxx;
I get
Symbol log4cxx could not be resolved
and for
std::vector<View*>& Model::GetRegisteredViews() { ... }
I get
Symbol vector could not be resolved
开发者_开发百科
and
Member declaration not found
(-> of GetRegisteredViews() although the decl. is available,
code compiles!)
All error messages are also marked with annotation symbols in the editor window, which is quite annoying.
From the stackoverflow forums I have learned that it might have to do with the fact that I had two versions of gcc installed, namely 4.1.2 and 4.4. I have already uninstalled 4.4 (using the package management system of RHEL, yum) - without success.
It might also have to do with the indexer, but frankly I have no idea where to start fixing this problem.
To me, it looks like Eclipse misses some include or library path entries, but both are mentioned in the Qt pro file as well as in Eclipse's project settings...
Your help would be highly appreciated, thank you for your comments!
It's not Qt per se - it's the CDT Indexer and the Qt Eclipse Integration plugin fighting. I find that performing a clean sometimes 'resets' the includes list in CDT project settings (only does this with Qt integration plugin running), but because Qt uses the .pro file - the compilation succeeds but CDT's CODAN (which uses the Eclipse project settings) throws a fit.
It's intensely irritating, and I haven't found a fix. Also Qt haven't updated the Qt Eclipse Integration for awhile, they want people to use Qt Creator - but it's awful for general development.
精彩评论