Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Analyzing mixed C/C++ and C-sharp projects

Analyzing mixed C/C++ and C-sharp projects

If your integration build contains both C++ and C# source files, there are special steps for both the server project and the desktop. This article explains these steps, with links to more details.

Integration build

At the integration build level, analyze your mixed source code as two separate projects.

  1. Create two integration projects with kwadmin create-project. For example:
    kwadmin create-project WBFSManager_CSharp
    kwadmin create-project WBFSManager_Cxx
  2. Create two build specification files: one for the C# files using kwcsprojparser, and one for the C/C++ files using kwinject. For example:
    kwcsprojparser "WBFS Manager.sln" --config Debug --output "WBFS Manager.out"
    kwinject "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" "WBFS Manager.sln" /Rebuild --output kwinject.out
  3. Run the analysis tool kwbuildproject twice. For example:
    kwbuildproject --tables-directory c:\klocwork\tables\wbfsmanager_csharp --url http://server01:8080/WBFSManager_CSharp "WBFS Manager.out"
    kwbuildproject --tables-directory c:\klocwork\tables\wbfsmanager_cxx --url http://server01:8080/WBFSManager_Cxx kwinject.out
  4. Load each project into the database with kwadmin load. For example:
    kwadmin load WBFSManager_CSharp c:\klocwork\tables\wbfsmanager_csharp
    kwadmin load WBFSManager_Cxx c:\klocwork\tables\wbfsmanager_cxx

Desktop

In Visual Studio, you create a single solution, but you connect it to two server projects. In the example above, your desktop project would be connected to both WBFSManager_CSharp and WBFSManager_Cxx on server01:8080. Your desktop project will synchronize with both integration projects.

To connect your desktop project to an integration project on the Klocwork Server, right-click a solution and select Klocwork Solution Properties. In the Klocwork Properties dialog, each language has its own tab.

Specify the C/C++ project name in the C++ Projects tab:

Specify the C# project name in the C# Projects tab:

Click OK.