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)
    -sonar-scanner-4.5.0.2216-windows
    -sonarqube-8.6.0.39681

  • 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.

Hi,

Welcome to the community!

What error message are you getting?

Also, have you seen the docs for analyzing C?

 
Ann

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.