> ## Documentation Index
> Fetch the complete documentation index at: https://docs.incredibuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrating with Klocwork

Last updated on Dec 22, 2025

Klocwork analyzes your code and detects defects and vulnerabilities. Incredibuild can integrate with Klocwork to accelerate these processes. You just need to install an Incredibuild agent on your Klocwork machines, and modify the commands you use to run Klocwork. You can read all the details below, but you can also check out [Klocwork's documentation](https://help.klocwork.com/current/en-us/concepts/runningkwinanincredibuildenvironment.htm).

## Prerequisites:

1. Klocwork must be installed with a valid license.

2. You also need the 'access Web API' permission in Klocwork. By default, this permission is assigned to project root admins and project admins. For more information about roles, see [Setting up roles](https://help.klocwork.com/current/en-us/concepts/enablingaccesstoklocworkprojects.htm#concept6218) in the Klocwork documentation.

3. An Incredibuild initiator agent must be installed on any Klocwork machines that will be used to run static code analysis. The initiator agent's license must have the Klocwork AddOn.

4. If you are using Incredibuild Cloud helpers, they must be able to communicate with your Klocwork license server.

## Analyzing a C++ Project Using Klocwork and Incredibuild

### Step 1: Create a Build Specification using [kwinject](https://help.klocwork.com/current/en-us/reference/kwinject.htm).

This step can be distributed and accelerated using Incredibuild's [buildconsole](/windows/10.34.1/running-from-command-line) command.

For example:

```
kwinject buildconsole.exe <"sln path"> /rebuild /cfg="Debug|Win64"
```

### Step 2: Run an Integration Build Analysis

This can be distributed and accelerated using Incredibuild's [xgConsole](/windows/10.34.1/devtools-command-line) command (the syntax is the same as the ibconsole command).

For example:

```
xgConsole /profile="C:\Klocwork\Server 21.1\config\xgProfile.xml" /title=<"title name"> /command="kwbuildproject --url http://localhost:8080/<project_name> -j [n] -o kwtables -f kwinject.out"
```
