Skip to content

NBCppUser guide

Install and use NBCpp

Start debugging a single C or C++ file on Windows x64.

Installation

In the VS Code Extensions view, search for NBCpp and install the extension published by Nebulazeyv. On Windows x64, you can use its bundled compiler and debugger, including on a fresh installation without MinGW, Visual Studio or the Microsoft C/C++ extension.

Your first debug session

  1. Open a project folder

    Choose File → Open Folder, then create and save main.cpp in that folder. Copy the example below into the file.

  2. Set a breakpoint and start

    Click the gutter beside the std::cout line. When the red dot appears, press F5. NBCpp configures a new workspace on first use. If the workspace already has a different launch configuration, use Smart Run in the upper-right corner of the editor to debug the current file.

  3. Enter a number and continue

    Type 21 in the integrated terminal and press Enter. When the debugger stops at the output statement, press F5 again. The terminal prints 42.

main.cpp
#include <iostream>

int main() {
    int n = 0;
    std::cin >> n;
    std::cout << n * 2 << '\n';
}

Keyboard shortcuts

ShortcutAction
F5Start debugging or continue from a breakpoint. This is the default VS Code debug shortcut.
F10Step over the current statement while paused.
Ctrl + Alt + CBuild and debug C with NBCpp while the editor has focus.
Ctrl + Alt + DBuild and debug C++ with NBCpp while the editor has focus.

Troubleshooting

The program seems to be waiting. Where do I type?

Programs that call scanf or std::cin wait for input. Open the Terminal panel, select the terminal running your program, type a value and press Enter. If execution is paused at a breakpoint, press F5 to continue first.

Can I debug the current file if my workspace already has a launch.json?

Open the source file and choose Smart Run in the upper-right corner of the editor. NBCpp selects a toolchain for that build and preserves your edited workspace configuration.

When reporting a problem, include your operating system, VS Code and NBCpp versions, and a small C or C++ program that reproduces it.

View or open an issue ↗