Windows调试
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations":
[
{
"name": "cl.exe",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/gltest/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment":
[
{"name": "LD_LIBRARY_PATH", "value": "/home/zym/mesa-project/installmesa/lib/x86_64-linux-gnu"},
{"name": "DISPLAY", "value": ":0"}
],
"MIMode": "gdb",
"setupCommands":
[
{
"description": "为gdb启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
Linux调试
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations":
[
{
"name": "cl.exe",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\Debug\\TK_AEC.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"MIMode": "gdb",
"setupCommands":
[
{
"description": "为gdb启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
添加包含目录
ctrl + shift + p打开命令面板,找到C/C++:编辑配置
点击之后,就可以生成c_cpp_propertites.json文件
在includePath中添加所需要的包含目录路径即可。