Search code examples
ceclipsesyntax-checking

How do you setup eclipse so that it parses and underlines errors for C like it does for Java?


How do you setup eclipse so that it parses and underlines errors for C as you type like it does for Java?


Solution

  • Install the CDT extension.

    Sadly, CDT is more limited than JDT... it can only find the absolute basic syntax errors itself (missing semicolons etc.), in part because a C or C++ build can be so heavily altered by flags to the tool chain, preprocessor variables etc. It can only highlight most errors and warnings after a build by parsing the output.

    One thing you can do that might make your life easier is to enable "Build on resource save". You can find that option under the "Behavior" tab of the "C/C++ Build" section of your project properties. This works pretty well for small projects that build quickly but could get annoying if it takes a while to build your project.