Skip to content

igormcoelho-learning/example-vscode-cpp

Repository files navigation

example-vscode-cpp

Example project for VSCode using Devcontainers for C/C++. See Google Slides presentation in Portuguese.

If not using devcontainers, then:

  1. Install basic Microsoft C/C++ extension ms-vscode.cpptools-extension-pack and allow it on configuration .vscode/settings.json:
    • "C_Cpp.intelliSenseEngine": "default",
  2. Install cpplint extension mine.cpplint
  3. Install catch2 tests extension matepek.vscode-catch2-test-adapter

If testing is desired, just update CMakeLists and make BUILD_TESTING to ON. If external fmt library is desired, just update CMakeLists and make USE_EXTERNAL_FMT to ON.

Recommended setup for VSCode

  • Do NOT use devcontainers (install clang compiler, cmake and ninja locally)
  • Use CMake 4.1 or 4.3 or latest (and update key on CMakeLists.txt accordingly)
  • Use ninja (not make)
  • Install extension clangd for vscode (and disable Microsoft C++ extension)
  • Use Clang instead of GCC on CMakeLists.txt (see presentation on how to do it)

Using cxxbuild project (for legacy 'tutorial-antigo-gcc-13')

The easiest way to build this is to just use cxxbuild project:

python3 cxxbuild.py

LICENSE

MIT License

About

Example of a working VSCode C++ repository with C++20 standard

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors