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

C++:工具VSCode的编译和调试文件内容:

ubuntu24.04, vscode 配置文件 C++ 的环境
下载的gcc,使用命令为

sudo aptitude update
sudo aptitude install build-essential -f- `sudo`: 以超级用户权限运行命令。
- `aptitude`: 包管理工具,用于安装、更新和删除软件包。
- `install`: 安装指定的软件包。
- `build-essential`: 一个包含编译软件所需基本工具的元包,包括 `gcc`、`g++`、`make` 等。
- `-f`: 尝试修复系统中存在的依赖关系问题。
note:这里在学习C++的GUI一块时,需要下载FTLK,但一直不能顺利下载成功,原因是我下载了gcc相关的package产生冲突,所以重装系统后使用了这种统一的命令安装。

默认下载在文件/usr/bin/g++

编译文件
task.json

{   //https://code.visualstudio.com/docs/cpp/config-linux"tasks": [{"type": "cppbuild","label": "C/C++: gcc build active file","command": "/usr/bin/g++","args": ["-fdiagnostics-color=always","-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": "build","detail": "Task generated by Debugger."}]
}

调试文件
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": [{"name": "(gdb) Attach","type": "cppdbg","request": "launch","program": "${fileDirname}/${fileBasenameNoExtension}","args": [],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": false,"MIMode": "gdb","setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true},{"description": "Set Disassembly Flavor to Intel","text": "-gdb-set disassembly-flavor intel","ignoreFailures": true}]},],}
http://www.lryc.cn/news/522231.html

相关文章:

  • SpringMVC Idea 搭建 部署war
  • YOLOv10-1.1部分代码阅读笔记-loaders.py
  • Windows的Redis查看自己设置的密码并更改设置密码
  • 【Linux】sed编辑器二
  • docker 部署 Kafka 单机和集群
  • PHP语言的软件开发工具
  • 前端【3】--CSS布局,CSS实现横向布局,盒子模型
  • SQL语句IN和OR的区别
  • OCP使用中的常见问题与解决方法
  • Git 版本控制:.gitignore 文件完全指南
  • STM32 FreeRTOS 介绍
  • 在 Azure 100 学生订阅中新建 Ubuntu VPS 并部署 Mastodon 服务器
  • 【Linux网络编程】序列化与反序列化
  • Spring Boot中的自动配置原理是什么
  • 大模型相关资料、基础技术和排行榜
  • 如何安装cnpm
  • 正则表达式 匹配特定字符后的所有字符
  • 计算机网络 (44)电子邮件
  • 数据结构与算法:动态规划dp:理论基础和相关力扣题(509.斐波那契数列、70.爬楼梯)
  • 某政务行业基于 SeaTunnel 探索数据集成平台的架构实践
  • word-break控制的几种容器换行行为详解
  • 【0x0084】HCI_Set_Min_Encryption_Key_Size命令详解
  • 关于2025年智能化招聘管理系统平台发展趋势
  • Docker部署Spring Boot + Vue项目
  • 开发规范
  • 九 RK3568 android11 MPU6500
  • openplant实时数据库(二次开发)
  • C语言:-三子棋游戏代码:分支-循环-数组-函数集合
  • “AI智慧化服务系统:未来生活的智能管家
  • python管理工具:conda部署+使用