I have installed Eclipse Indigo for C/C++ Linux developers on Ubuntu 10.04 x86.
When I use common predefined macro __BASE_FILE__
Eclipse says Sym
This is a file indexing issue.
Solution - Right click on the project, Index->Freshen all files.
(Applies to Eclipse CDT.Oxygen)
Updated: You have to add proper paths to Project->Propoerties->C/C++ General->Paths and Symbols. If it does not help, you can configure Eclipse Code Analyser (which generates the 'errors') in Project->Properties->C/C++ General->Code Analysis. Under the error description you have problem with, try Customize Selected->Scope->Exclusion Patterns.
I think it has something to do with the workspace/.metadata. I had the problem of semantic errors reported but Hello World compiles and runs. I deleted the project, created another one, same error reporting. Reinstalled CDT, same thing. Deleted the workspace, shut down Eclipse, restarted, created new hello world, same thing. Deleted the workspace again, shut down Eclipse again, this time noticed that Eclipse had recreated the workspace folder during shutdown when it couldn't find it. Deleted the workspace with Eclipse shut down. Restarted Eclipse, created HW project, errors show for about a second and then gone. Deleted project, created another one, errors show for a sec, then poof. If you actually had projects in your workspace (mine was a clean install), I bet that you could just delete the .metadata folder within the workspace, and it would fix it.
If on Ubuntu, go to Window > Preferences > In Search box type "Indexer" > Select Indexer in left column. Under heading "Indexer Options" tick the following options (all but those involving the skipping of files):
Under heading "Indexing Strategy" tick both options which are:
Under heading "Build Configuration for the indexer" select the following option:
Not sure if this addresses your specific problem, but I also had semantic errors. They just came out of the blue after having a working project.
Anyway, I fixed it with a single option in workspace settings by setting: "Build configuration for indexer: Use active build configuration"
The other option was "Use the build configuration specified in the project's indexer settings" and this is the one that wasn't working. I think it may have been corrupted after an eclipse crash.
In the past, I would define the ANDROID symbol in: Project -> Properties->C/C++ General -> Paths and Symbols -> #Symbols tab However, the latest version of Eclipse no longer has a # Symbols there, or anywhere else. It seems there is no longer any way of defining symbols in Eclipse. Eclipse has so many bugs and problems. I finally gave up and switched to using Gedit and the terminal to compile.