# java.lang.IllegalStateException: 0 C/C++/Objective-C files were analyzed

**URL:** <https://community.sonarsource.com/t/java-lang-illegalstateexception-0-c-c-objective-c-files-were-analyzed/58716>\
**Category:** SonarQube Server / Community Build\
**Tags:** build-wrapper, sonarqube, cfamily\
**Created:** [February 21, 2022, 6:37pm UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-0-c-c-objective-c-files-were-analyzed/58716 "2022-02-21T18:37:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kishore535](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/kishore535/32/18597_2.png) [@kishore535](https://community.sonarsource.com/u/kishore535)\
**Post date:** [February 21, 2022, 6:37pm UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-0-c-c-objective-c-files-were-analyzed/58716/1 "2022-02-21T18:37:31Z")

</div>

Hello Team,  
I am running this sonarqube from my project and I am getting this error. It is not able to scan the c/c++ code. The scanner is running fine but not able to scan the c/c++ code.

Here is the configuration:  
sonar.host.url=[http://172.20.40.114:8443](http://172.20.40.114:8443)

sonar.projectKey=ssgsonarqube  
sonar.projectName=SSG  
sonar.projectVersion=1.0

# Your relative path to source folder may be different

sonar.sources=/home/builds/tsd-jenkins-be/nightly-builds/ssg  
sonar.cfamily.build-wrapper-output=/home/builds/sonarqube/ssg/build\_output  
sonar.java.binaries=.

# Encoding of the source files

sonar.sourceEncoding=UTF-8

We are also running the build-wrapper as:  
build-wrapper-linux-x86-64 --out-dir /home/builds/sonarqube/ssg/build\_output make all

attached the build-wrapper.log and build-wrapper-dump.json files  
[build-wrapper.log](https://community.sonarsource.com/uploads/short-url/iH8A6RnWntCgCHxk0ra4qyfVBXb.log) (362.0 KB)  
[build-wrapper-dump.json](https://community.sonarsource.com/uploads/short-url/A9C9Q9vSTEBo9T0PC2DmU4ebUtr.json) (26.5 KB)

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [February 23, 2022, 10:45am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-0-c-c-objective-c-files-were-analyzed/58716/3 "2022-02-23T10:45:25Z")

</div>

Hello @kishore535,

Looking at the output of the build wrapper, it seems only the linking step was captured. To properly analyze your project, you need to capture all build commands. To achieve this, it is best to do a clean build.

[Analysis Steps Using Build Wrapper](https://docs.sonarqube.org/latest/analysis/languages/cfamily/#header-5) gives an example for make:

```auto

build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory make clean all

```

Given your build command, you may want to add `clean` before `all` if it is properly defined in your Makefile.

I also see you used a full path for the `sonar.sources` property. It is best practice to use a relative path instead.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [June 2, 2022, 12:34pm UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-0-c-c-objective-c-files-were-analyzed/58716/4 "2022-06-02T12:34:48Z")

</div>

Closed on June 2, 2022, 12:34pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
