Boost Your C/C++ Code Quality with CppDepend - Get Started Today

Getting Started with CppDepend on Windows

Download the CppDepend installer

1) If you didn't download yet the CppDepend Installer, please refere here: https://www.cppdepend.com/download

2) Install CppDepend Professional files on your computer. To install CppDepend, just unzip the files in a private application folder on your machine. Don't unzip files in '%ProgramFiles%\CppDepend'. This could provoke problems because of Windows protection.

Getting Started Video (3 min)

How do I analyze my C\C++ applications using CppDepend?

  • Run VisualCppDepend.exe.
  • Create New CppDepend Project

    Create New Project
    You have to specify the analysis view which is more suitable for your projects:
    • Logical structure: Where the code base is grouped per namespaces

      Logical structure
    • Physical structure: Where the code base is grouped per files and folders

      Physical structure

  • Add your C/C++ projects.

    adding new C/C++ Project

    The following kind of projects are managed by CppDepend:

    • .vcproj,.vcxproj,.sln: Visual Studio projects.
    • Qt projects : CppDepend supports out of the box the QtCreator projects.
    • Json compilation database: A compilation database is a database for compile options. It records which compile options are used to build the files in a project. The compilation database could be generated from CMake or Ninja, and there are many other ways to generate a compilation database.
    • .build files : The recommended way to analyse your C\C++ projects other than the VS, QtCreator and CMake ones, is to use the BuildMonitor tool to intercept all compilation and link commands.
    • Set of source files: You can use the ProjectMaker tool to describe the specification of your project. With ProjectMaker you can specify your source files, the include paths and the defines.
  • Click F5 to analyze your projects.The analysis will take a few seconds to a few minutes depending on the size of the projects.
  • Once the analysis done, the result is displayed in the VisualCppDepend.exe UI.

    VisualCppDepend Dashboard

Installing the CppDepend add-in for Visual Studio 2022, 2019, 2017, 2015, 2013, 2012 and 2010



  • Download the CppDepend installation zip file
  • To install CppDepend, just install the files in a private application folder on your machine.
    Don't install files in '%ProgramFiles%\CppDepend'. This will cause problems due to Windows protection.
  • Start CppDepend.VisualStudioExtension.Installer.exe or Start VisualCppDepend and install the VS add-in from the start page.
  • Click the Install button for the right Visual Studio version

    Visual Studio Add-in

Analyzing a Visual Studio solution

  • Start Visual Studio after having installed the CppDepend add-in.
  • Open the Visual Studio solution containing the code to analyze.
  • Click the greyed CppDepend circle status (bottom right of the Visual Studio window)
    OR
    click the menu CppDepend > Attach new CppDepend project to current Visual Studio solution

    Note:
  • A CppDepend project can be attached to several Visual Studio solutions.
  • This is useful if you wish to analyze several C/C++ projects compiled with several Visual Studio solutions.
  • The benefit will be the ability to navigate across several Visual Studio solutions opened in several Visual Studio instances.

    CppDepend Menu in within Visual Studio
  • The dialog opened has been populated with the Visual Studio solution. Here you can add more projects compiled from another solutions

    Adding CppDepend project in Visual Studio
  • Launch the CppDepend analysis start. It will just take a few minutes to analyze your code base for the first time.

What does the CppDepend report tell me about my code?

  • Application Metric: This section gives you an idea of the topology of your application.
  • Project Metric: This section gives you an idea of the size of each project within your application in terms of code line and others metrics.
  • VisualCppDepend View: This section illustrates the size of your projects, namespaces, types and methods in terms of code line. You can browse this view dynamically by clicking the Launch Visual CppDepend on this Project icon in the CppDepend.Project UI.
  • Project Abstractness vs. Instability: This section illustrate the Abstractness/Instability principle explained in the projects metrics section.
  • Project Dependencies: This section shows all dependencies between project of your application in a table.
  • Project Dependency Diagram: This section shows all dependencies between projects of your application in a diagram
  • Project build order: This section gives you one of the possible build order for your projects. If a cycle exists in your projects dependencies graph, this section will report it.
  • CQLinq Queries and Constraints: This section reports default CQLinq constraints which have been violated. More about the CQLinq language and CQL constraints. You can build your own CQLinq constraints with VisualCppDepend.
  • Type Metrics: This section recaps type metrics in a table. A link to the documentation is provided for each metric.

I want to go further to have a better control over my code

  • Understand metrics yielded by CppDepend and read recommendations.
  • Get a new understanding of your code by playing with the CppDepend panels. Modify the view with the Level and Metric combo boxes.
  • Fine-tune your report thanks to the Output panel in the CppDepend.Project UI.
  • Learn CQLinq, adapt existing CQLinq code rules and create your own ones.

CppDepend offers a wide range of features. It is often described as a Swiss Army Knife for C and C++ developers.

Start Free Trial