This article is a mirror article of machine translation, please click here to jump to the original article.

View: 635|Reply: 0

[C++] VSCode makes it easy to configure C/C++ environments

[Copy link]
Posted on 2025-10-24 12:43:21 | | |
Search for "C++"
Install Microsoft's official "C/C++" plugin
C/C++ Extension Pack
sudo apt install gdb lldb
sudo apt-get install build-essential gdb
build-essential package that contains the required software

  • tasks.json (compiler build settings)
  • launch.json (debugger settings)
  • c_cpp_properties.json (compiler path and IntelliSense settings)
configuration of these three files
IntelliSense
1、tasks.json
In the upper right corner of VSCode, run the C++ file
The middle pops up the C++ build and debug activity file
A .vscode folder is generated in the program directory
Inside is a tasks.json file
label to hello c
In the upper right corner, debug the C++ file
2、launch.json
The button on the left Click Run and Debug is also available for debugging
Add configuration Add gdb debug to start
name to hello
program to ${workspaceFolder}/hello/hello hello is the generated executable
3、c_cpp_properties.json
ctrl+shift+p
In the middle, select C/C++ to edit the configuration UI
Set the path of the compiler to /usr/bin/gcc
IntelliSense modelinux-gcc-x64











Previous:vscode compiler
Next:C language containerized development environment configuration
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com