Eclipse CDT shows semantic errors, but compilation is ok

后端 未结 20 1393
青春惊慌失措
青春惊慌失措 2020-12-01 07:42

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

相关标签:
20条回答
  • 2020-12-01 08:25

    In my case, I eventually discovered that the indexer was having problems because a colleague had “helpfully” duplicated a whole load of declarations in two header files that were only included together in a small subset of C files in the project. Removing the duplications (and making one header include the other) allowed the indexer to function correctly again.

    It was particularly a problem with duplicated enumerations, for some reason. I do not know why this is so.

    0 讨论(0)
  • 2020-12-01 08:25

    I had a similar issue but my compile was fine but Eclipse showed errors on lines that used a #define from another include file. I fixed by checking "Index all header variants". I think the classis #ifndef FILENAME in include file was process multiple times in Indexer and so 2nd time the FILENAME was defined so all #defines in .h file were not "seen" by the preprocessor. Go to Window | Preferences | C/C++ | Indexer.

    0 讨论(0)
提交回复
热议问题