So I am building some Arduino code in eclipse, as described in Your Second Arduino Project, but every time I use an Arduino library, such as Serial
, Eclipse und
In my case the problem was due to adding "-std=c++17" flag in the language standard field in the project properties under the compile dialect. After that the build was passing with errors, but the program was running fine. So the trick of Index>Rebuild resolved everything.
When resolving symbols, CDT indexer seems to consider all header files irrespectively of which ones are actually included in the compilation unit. There is a corresponding bug report filed with Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=439553
If you changed something in the configurations, (example, editing in *.cproject file with notepad++) , the below options helps. Build Configurations --> Clean All and then Index --> Rebuild