Eclipse doesn’t index lines in ifdef
Yes Eclipse has an internal parser and that parser builds and indexes your code so that you can work on it easily. If a definition is not in build, eclipse automatically skips that part from indexing and reduces the amount of built code accordingly. However for big projects sometimes we don’t use eclipse’s internal builder but some makefiles or ant build files. In that case, if you want your code to be open, you should add those definitions to eclipse’s internal parser. In order to do that:
- Right click to project and select Properties.
- Under C/C++ General tab go to Paths and Symbols.
- Add your definition in Symbols tab.
- Apply your changes. Eclipse will rebuild the index.
Enjoy coding!
Comments