SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?): SonarQube Server
And a thorough description of the problem / question:
Hi,
I am struggling to get SonarQube for Eclipse working for my embedded C project. I have installed SonarQube for Eclipse, I have installed CDT, I have built my project in Eclipse and I have setup Connected Mode. But still, every time I open a C file, I simply get the error “SonarQube - C/C++ analysis not available (yet)”.
In VScode I was simply able to use the build_wrapper.exe to generate a compilation database, in the form of compile_commands.json, and then point the SonarQube extension to that file, and SonarQube was working great.
How can I achieve the same in Eclipse? Where am I going wrong? Thanks.
SonarQube for Eclipse does not rely on the Compilation Database (yet) but relies on the Eclipse CDT integration instead. This is configured to create the Build Wrapper automatically in the background based on the information CDT has on your files and the project.
I See your CDT Build Console has no issues, but the Problems view shows some. What does it say, especially what markers are there from the CDT plug-in? Additionally, as @ganncamp mentions above, the logs are equally helpful.
Thanks for the replies. After checking the logs and errors I saw that Eclipse was failing to resolve basic types like ‘bool’. Since it was still building, I didnt think it would affect SonarQube, but I decided to try and fix it anyway. I was able to fix that by changing the tool chain to “MinGW GCC” and adding the relevant includes to “Paths and Symbols”. With these changes I am no longer seeing the “analysis not available” error, thank you!