A minimal C++ "Hello World" project configured for GitHub Codespaces, VS Code, and CMake.
- Create a new repo on GitHub and add these files.
- In the repo page, click Code > Codespaces > Create codespace on main.
- After it opens, build and run:
- Run task:
Build (CMake)
or pressCtrl/Cmd+Shift+B
- Run the program:
- Task:
Run Hello
- Or use Debug: "Run Hello (gdb)"
- Task:
- Run task:
- Install: VS Code, C/C++ extension, CMake Tools, and optionally Dev Containers.
- If using Dev Containers, open the repo folder in VS Code and "Reopen in Container" to match Codespaces.
- Build/Run via the provided tasks or CMake Tools commands.
- Configure:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
- Build:
cmake --build build -j
- Run:
./build/hello
A basic GitHub Actions workflow builds and runs the program on Linux.