# No configured compilation database

**URL:** <https://community.sonarsource.com/t/no-configured-compilation-database/98111>\
**Category:** VS Code\
**Created:** [August 26, 2023, 12:10am UTC](https://community.sonarsource.com/t/no-configured-compilation-database/98111 "2023-08-26T00:10:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Isaacson](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tom_isaacson/32/48612_2.png) [@Tom\_Isaacson](https://community.sonarsource.com/u/Tom_Isaacson)\
**Post date:** [August 26, 2023, 12:10am UTC](https://community.sonarsource.com/t/no-configured-compilation-database/98111/1 "2023-08-26T00:10:32Z")

</div>

- Operating system: Windows 11 with WSL2 running Ubuntu 22.04
- SonarLint plugin version: v3.20.2
- Programming language you’re coding in: C++
- Is connected mode used: No

I just installed the SonarLint extension but it keeps popping up this message “SonarLint is unable to analyze C and C++ file(s) beause there is no configured compilation database”. When I click on “Configure compile commands” nothing happens.  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/c/c/ccfdb587e87e26bde0beb50e23914b324a665b8b.png)

---

<div class="post-metadata">

**Author:** ![Kirill\_Knize](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/kirill_knize/32/11771_2.png) [@Kirill\_Knize](https://community.sonarsource.com/u/Kirill_Knize)\
**Post date:** [August 30, 2023, 11:35am UTC](https://community.sonarsource.com/t/no-configured-compilation-database/98111/4 "2023-08-30T11:35:24Z")

</div>

Hello @Tom_Isaacson and welcome to the community!

After clicking the “Configure compile commands” button something definitely should happen.

1. It may be a quick pick list if there are more than one `compile_commands.json` file in the project.
2. Also it maybe a warning notification if there is no `compile_commands.json` file found.
3. The least obvious may be the case when you have exactly one `compile_commands.json` file in your project. Then you will get the notification that the database is configured and your `project/.vscode/settings.json` will be modified.

So first please can you check your `settings.json`. If there is a property `sonarlint.pathToCompileCommands`?  
It should look similar to this:  
`"sonarlint.pathToCompileCommands": "${workspaceFolder}/cmake-build-debug/compile_commands.json"`

If there is no such property, then I ask you to [enable verbose logging](https://docs.sonarsource.com/sonarlint/vs-code/troubleshooting/), trigger the compilation database setup, and upload the SonarLint output here. To manually trigger the compilation database setup you can invoke the command called “Configure the compilation database for C and C++ analysis” using the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) of VSCode.

---

<div class="post-metadata">

**Author:** ![Tom\_Isaacson](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tom_isaacson/32/48612_2.png) [@Tom\_Isaacson](https://community.sonarsource.com/u/Tom_Isaacson)\
**Post date:** [September 1, 2023, 1:13am UTC](https://community.sonarsource.com/t/no-configured-compilation-database/98111/5 "2023-09-01T01:13:31Z")

</div>

This was before I set anything up, I don’t think I was even generating a compile\_commands.json file yet. I’ve now setup my build so the dialog isn’t appearing. If I see the problem again I’ll grab the log.

---

<div class="post-metadata">

**Author:** ![Tom\_Isaacson](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tom_isaacson/32/48612_2.png) [@Tom\_Isaacson](https://community.sonarsource.com/u/Tom_Isaacson)\
**Post date:** [September 1, 2023, 1:18am UTC](https://community.sonarsource.com/t/no-configured-compilation-database/98111/6 "2023-09-01T01:18:01Z")

</div>

Just noticed I’ve been upgraded to v3.21.0 and I can’t seem to recreate the problem anymore.

---

<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:** [September 8, 2023, 7:26am UTC](https://community.sonarsource.com/t/no-configured-compilation-database/98111/8 "2023-09-08T07:26:21Z")

</div>

Closed on September 8, 2023, 7:26am UTC

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