How to scan a C project in sonarqube?

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

  • what are you trying to achieve

I am trying to scan a C project for quality.

  • what have you tried so far to achieve this

I installed sonarqube and used sonar-scanner to scan the codes present in the src directory. But I am getting an error message.


Welcome to the community!

What error message are you getting?

Also, have you seen the docs for analyzing C?


I need steps for build wrapper.

I tried this command:

build-wrapper-win-x86-64.exe --out-dir  build_wrapper_output_directory MSBuild.exe /t:Rebuild

getting the below error:
[SONARSOURCE BUILD-WRAPPER] failed to execute MSBuild.exe /t:Rebuild: The system cannot find the file specified.

I have seen the link but cannot understand the actual work steps.

I need a workflow along with the command to analyze C Project, lets say all codes are in one directory only.

To be able to run the build wrapper from the command line, you should first be able to compile your project on the command line. The first step with visual studio is usually to open a pre-configured console, instead of the default windows console. It will contain a working environment from which you can run MsBuild.

It can be found in the start menu with a name like: Developer Command Prompt for VS 2019.

Then you should check that you can correctly compile with MsBuild, and only then you should trigger MsBuild from the build wrapper.