Reputation: 1408
I'm working on a large C project (multiple makefiles, modified third party code, etc.) and I would like to use Eclipse as a graphical front-end for GDB and for browsing/editing the code.
Right now I have a problem where Eclipse can resolve the macros and functions in the code, but not data structures or enums. Please note I am only concerned with browsing/editing the code. I will compile the project outside of Eclipse. I should also mention that Eclipse has no trouble resolving anything from a standard C library. I see that is a common question, but that is not a problem here.
So far I've done the following:
If I'm browsing a source file, I can right click and select "Open Declaration" to see macro definitions and function definitions, even if those definitions are in other files. This is not working for data structures or enums. Eclipse reports Type "StructureX" could not be resolved?
What do I need to do so Eclipse can resolve data structures?
Update
I just looked at the parser.log file. I see "Attempt to use symbol failed:" for the structures and enum members Eclipse can't resolve, but I don't see the reason why.
Upvotes: 3
Views: 2610
Reputation: 1408
I found the answer, oddly enough, because the default color scheme was bothering me. When I switched to a more soothing black background, I noticed that Eclipse thought all of the #ifdef DEFINE_NAME_X
macros were undefined.
The enums and macros that the Indexer was not able to find were inside these statements.
Once I opened Properties->C/C++ General->Paths and Symbols->Symbols and defined a few key macros, the indexer was able to find the missing symbols.
Upvotes: 2