对于在有好些个文件的项目中编译,用命令行来编译就不妥当了这时候就需要写makefiel来编译运行了。具体配置如下:task.json{// See https://go.microsoft.com/fwlink/?LinkId=733558// for the documentation abo...
对于在有好些个文件的项目中编译,用命令行来编译就不妥当了
这时候就需要写makefiel来编译运行了。
具体配置如下:
task.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "g++ build active file",
"type": "shell",
"command": "make"
}
]
}
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/web",
"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"
}
]
}
其中 "program": "${workspaceFolder}/web" 中的web要和你在makefile中最终生产目标一致即可
沃梦达教程
本文标题为:vscode编译调试C/C++多文件——linux(makefile)
猜你喜欢
- Qt计时器使用方法详解 2023-05-30
- ubuntu下C/C++获取剩余内存 2023-09-18
- c++ const 成员函数,返回一个 const 指针.但是返回的指针是什么类型的 const? 2022-10-11
- 详解C语言中sizeof如何在自定义函数中正常工作 2023-04-09
- C语言手把手带你掌握带头双向循环链表 2023-04-03
- C++ 数据结构超详细讲解顺序表 2023-03-25
- C语言详解float类型在内存中的存储方式 2023-03-27
- C语言qsort()函数的使用方法详解 2023-04-26
- 我应该为我的项目使用相对包含路径,还是将包含目录放在包含路径上? 2022-10-30
- Easyx实现扫雷游戏 2023-02-06
