https://github.com/leoliu0605/vscode.cpp
Demonstrate how to develop C/C++ projects using VSCode.
https://github.com/leoliu0605/vscode.cpp
cpp example hello-world vscode
Last synced: 10 months ago
JSON representation
Demonstrate how to develop C/C++ projects using VSCode.
- Host: GitHub
- URL: https://github.com/leoliu0605/vscode.cpp
- Owner: leoliu0605
- License: mit
- Created: 2023-09-27T03:39:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T08:04:27.000Z (over 1 year ago)
- Last Synced: 2025-03-28T16:03:51.749Z (10 months ago)
- Topics: cpp, example, hello-world, vscode
- Language: C++
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Visual Studio Code C/C++ Development Environment Setup
This example provides a guide for setting up a C/C++ development environment using Visual Studio Code, which can be executed on Windows, macOS, and Linux. For detailed instructions, please refer to [this article](https://blog.dinosauria.xyz/blog/write-cpp-with-vscode-2024/).
## Environment Setup
### Windows
First, use `winget` to install `Visual Studio Code` and `Chocolatey`, then use `Chocolatey` to install `mingw`.
```shell
winget install --id=Microsoft.VisualStudioCode -e
winget install --id=Chocolatey.Chocolatey -e
```
```shell
choco install -y mingw
```
### macOS
Use [brew](https://brew.sh/) to install `Visual Studio Code` and install `clang` & `lldb` via `xcode-select`.
```shell
brew install --cask visual-studio-code
```
```shell
xcode-select --install
```
Verify the installation of `clang` and `lldb`.
```shell
clang --version
lldb --version
```
### Linux
Use `apt` to install `gcc`, `g++`, and `gdb`.
```shell
sudo apt update
sudo apt install -y build-essential
sudo apt install -y gdb
```
## Compile, Run, and Debug
After cloning the repository, use `Visual Studio Code` to open the folder. Open `main.cpp`, press `F5`, and you can start compiling and running the program.
```shell
git clone https://github.com/leoli0605/vscode.cpp
```