A general C++ project template, using a Makefile with building, running and testing capabilities.
It includes:
- a Makefile with build and run rules, with GDB and config flags already present.
- a project structure
.vscode
folder with the necessary config files to use VSCode code correction and the integrated GDB debugger.
If you use VSCode
:
ms-vscode.cpptools
: extention comming with GDB debugger integration.
This template supports NixOs dev environment. Update the flake.lock
file with nix flake update
, and enter dev environment with nix develop
.
First, click the green Use this template
button near the top of this page. This will take you to Github's Generate Repository page. Fill in a repository name and short description, and click Create repository from template
. This will allow you to create a new repository in your Github account,
prepopulated with the contents of this project. Now you can clone the project locally and get to work!
git clone https://github.com/<user>/<your_new_repo>.git
- Inside the cloned repo folder, make the necessary directories for compilation with
make dirs
. Then build and start coding/debugging. - Compile
main
withmake build
. - Compile
test
withmake built_test
. - Run
main
withmake run
. - Run
test
withmake run_test
.