当前位置: 首页 > news >正文

关于vs code Debug调试时候出现“找不到任务C/C++: g++.exe build active file” 解决方法

vs code Debug调试时候出现“找不到任务C/C++: g++.exe build active file” ,出现报错,Debug失败

 


后来经过摸索和上网查找资料解决问题

方法如下

在Vs code的操作页面左侧有几个配置文件

红框里的是需要将要修改的文件

 查看tasks.json和launch.json框选"  "的字符串是否一致

完成后,按F5启动调试,报错弹窗消失,顺利完成调试

下面是 我的 Vs code中tasks.json和launch.json源文件

{"tasks": [{"type": "shell","label": "g++ build active file","command": "/usr/bin/g++","args": ["-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"],"options": {"cwd": "/usr/bin"}},{"type": "cppbuild","label": "C/C++: g++ 生成活动文件","command": "/usr/bin/g++","args": ["-fdiagnostics-color=always","-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": "build","detail": "编译器: /usr/bin/g++"}],"version": "2.0.0"
}

 

{// 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": [{"name": "g++ - 生成和调试活动文件","type": "cppdbg","request": "launch","program": "${fileDirname}/${fileBasenameNoExtension}","args": [],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": false,"MIMode": "gdb","setupCommands": [{"description": "为 gdb 启用整齐打印","text": "-enable-pretty-printing","ignoreFailures": true}],"preLaunchTask": "g++ build active file","miDebuggerPath": "/usr/bin/gdb"}]
}

 

http://www.lryc.cn/news/241638.html

相关文章:

  • 交叉导轨在光学工作台起什么重要作用?
  • 易点易动固定资产管理系统:实现固定资产与财务系统的高效对接
  • 做亚马逊多久可以赚钱?做亚马逊需要多少资金?——站斧浏览器
  • 计算机应用基础_错题集_基础知识---网络教育统考工作笔记006
  • C#面试题3
  • MariaDB(基础信息)
  • SpringBoot + 通义千问 + 自定义React组件,支持EventStream数据解析!
  • Redis中文结果查看方式
  • 计算机组成原理-磁盘存储器
  • 连接docker swarm和凌鲨
  • Qt实现画的图片移动
  • 比较2个点的3种结构在不规则平面上的占比
  • 最小二乘线性回归
  • 【django+vue】连接数据库、登录功能
  • NX二次开发UF_CSYS_edit_matrix_of_object 函数介绍
  • 封装公共el-form表单
  • OpenHarmony-4.0-Release 源码编译记录
  • HTML新手入门笔记整理:块元素和行内元素
  • Hook+jsdom 解决cookie逆向
  • 【封装UI组件库系列】封装Icon图标组件
  • STM32:基本定时器原理和定时程序
  • EntityFramework 批量删除操作
  • springboot使用的设计模式
  • IP地址定位技术发展与未来趋势
  • AI与交通运输
  • window.requestAnimationFrame+localStorage+canvas实现跨窗口小球连线效果
  • 使用AndResGuard报错:copy res file not in resources.arsc file:Ezi.xml
  • 插入排序(形象类比)
  • ElasticSearch 同步的方式
  • easyExcel实现分批导入,动态表头分批导出,以及导出表格样式设置