SonarLint C++ Eclipse


i read in some threads that SonarLint for Eclipse should work for C++ projects if cdt is used. Is this correct? If so, i cannot get SonarLint running for C++ code.

In VScode i have to specify the compile_commands.json, however, i cannot find any settings for sonarlint in eclipse. Am i missing something?

My OS is Ubunut and i am using connected mode to SonarCloud.

Best regards,

Hello @Sebastian1

C++ is supported in SonarLint for Visual Studio, Visual Studio Code, CLion, and Eclipse.
Unlike all the other IDEs, SonarLint for C++ on Eclipse requires you to be in connected mode.
It means your SonarLint connects to a SonarQube instance or to SonarCloud to get the C++ analysis capability on a project analyzed there.
It also means that your SonarLint C++ support depends on your offer on the other product.
You can analyze a C++ project on SonarQube starting from Developer Edition. On SonarCloud, you can analyze public C++ projects for free and with a subscription for private projects.

Again, these limitations do not apply to Visual Studio, Visual Studio Code, and CLion, where the C++ analysis capability is embedded and available for free for any project in SonarLint.

EDIT: I missed that Sebastian is in connected mode, so it is not helpful. Though, I leave this here for reference.

From what @Sebastian1 wrote, C++ analysis should be supported.

@Sebastian1 would you mind enabling verbose + analysis logs, and sharing the logs of a single analysis (clear console, close/reopen a C++ file).

1 Like

Hi Julien,

thank you for the hint, the verbose output helped me find the issue.
There was an issue with my compiler, which lead SonarLint to “ignore” all issues.
Having fixed the compiler issue got SonarLint working again.