SonarQube execution Error for c++ code using build-wrapper

Hi …I am getting Exection failure with below error while doing sonar-scanner for c++ code using build-wrapper and sonarqube version * Enterprise Edition

  • Version 7.9.1 .can someone help me on this.
    12:28:58.280 DEBUG: Using build-wrapper-dump.json probe
    12:28:58.282 WARN: Invalid probe found, skip analysis of files:

The compiler probe ‘stdout’ is expected to contain at least one ‘#define’ directive:

12:28:58.284 INFO: Subprocess(es) done in 53ms
12:28:58.284 INFO: 0 compilation units analyzed
12:28:58.325 INFO: ------------------------------------------------------------------------
12:28:58.325 INFO: ------------------------------------------------------------------------
12:28:58.326 INFO: Total time: 1:43.446s
12:28:58.483 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:

  • you are using the latest version of the build-wrapper and the SonarCFamily analyzer

  • you are correctly invoking the scanner with correct configuration

  • your compiler is supported

  • you are wrapping your build correctly

  • you are wrapping a full/clean build

  • you are providing the path to the correct build-wrapper output directory

  • you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
    at com.sonar.cpp.plugin.CFamilySensor.execute(
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
    at org.sonar.core.platform.ComponentContainer.startComponents(
    at org.sonar.core.platform.ComponentContainer.execute(
    at org.sonar.scanner.scan.ProjectScanContainer.scan(
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
    at org.sonar.core.platform.ComponentContainer.startComponents(
    at org.sonar.core.platform.ComponentContainer.execute(
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
    at org.sonar.core.platform.ComponentContainer.startComponents(
    at org.sonar.core.platform.ComponentContainer.execute(
    at org.sonar.batch.bootstrapper.Batch.doExecute(
    at org.sonar.batch.bootstrapper.Batch.execute(
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
    at com.sun.proxy.$Proxy0.execute(Unknown Source)12:28:58.483 INFO: Final Memory: 32M/117M
    12:28:58.483 INFO: ------------------------------------------------------------------------

    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
    at org.sonarsource.scanner.api.EmbeddedScanner.execute(
    at org.sonarsource.scanner.cli.Main.execute(
    at org.sonarsource.scanner.cli.Main.execute(
    at org.sonarsource.scanner.cli.Main.main(

Can someone help me on this.

Hi @mpaladin i am facing similar problem like
Invalid probe found ,skip analysis of files . I am using clang compiler and i am unable to do successfully the sonar scanner.
Execution failure.can you help me on this?

Hi @Prakash_Vadaga,

what compiler are you using? What version of the cfamily analyzer have you installed?

And please, do not tag people directly to ask for help :pray: .

sorry i have seen similar issue that you were discussing on the post.
Compiler: clang .
cfamily analyzer version where can i able to see the version.

Hi @Prakash_Vadaga,

You can see it in the SonarQube UI in the Marketplace.

version of cfamily analyzer : SonarCFamily (cpp)
compiler : clang++.
I am able to scan the results using below command
build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-outputs make clean clean all.
but i am seeing zero coverage report.
Can you please help me the steps required to generate coverage report and pass the coverage report to sonarqube dashboard.

Our project has our cpp code inside src/ under different folders. Can you suggest the coverage tools compatible with clang++ compiler and supported by sonarqube as well.

Hi @Prakash_Vadaga,

did you make progress on that? To generate coverage report for your project you can find many guides on internet.