文章目录
VSCode配置
1.mingw 下载和环境变量设置
2.code runner配置
1)创建一个.vscode的文件夹,下面放三个文件launch.json,settings.json,tasks.json
配置参考
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
//包含Debug配置
"name": "gcc.exe - 生成和调试活动文件",//配置名称
"type": "cppdbg", //配置类型,对应cpptools提供的调试功能
"request": "launch", //请求配置类型,可以是启动/附加类型[launch/attach]
"program": "${fileDirname}\\build\\${fileBasenameNoExtension}.exe",//待调试程序本地路径
"args": [], //程序调试时传递给程序的命令行参数,设为空值
"stopAtEntry": false,//改为true时程序暂停在程序入口位置,即main处打上断点
"cwd": "${workspaceFolder}", //调试程序时的工作目录,这里表示源码目录

本文介绍了如何在VSCode中配置C++开发环境,包括安装mingw和设置环境变量,以及如何使用Code Runner进行编译运行。同时,文章提及了避免头文件重复包含的编译错误和模板类的使用。
最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



