找不到G++尝试添加配置时构建和调试活动文件
我正在运行最新的VSCODE在Ubuntu上安装了.deb 20.04在笔记本电脑上。 安装了C/C ++扩展V 1.9.7(最新)。
我遵循了教程中的所有内容 https://code.visalstudio.com/docs/docs/docs/cpp/cpp/config/config-linux-linux-linux
我被困在调试中,因为我无法在启动中选择G ++构建和调试活动文件
。JSONTASK.JSON是自动生成的,如下所示
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/g++"
}
]
}
,当我尝试选择Run≫添加配置...并选择C ++(GDB/LLDB), 我认为“ G ++构建和调试活动文件”的下拉列表没有
有什么建议吗?
I am running the latest vscode installed with .deb on ubuntu 20.04 on a laptop.
C/C++ extension v 1.9.7 (latest) was installed.
I followed everything in the tutorial in
https://code.visualstudio.com/docs/cpp/config-linux
and I am stuck in the debugging as I cannot choose g++ build and debug active file in launch.json
task.json is auto generated as below
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/g++"
}
]
}
And when I tried to select Run > Add Configuration... and choose C++ (GDB/LLDB),
I see no drop down list for "g++ build and debug active file"
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题:仅出现一个“ GDB(启动)”选项,而文档则说“ G ++构建和调试活动文件”应该出现。
就我而言,这是因为调试器
gdb
根本没有安装在我的系统上。我已经忽略了Linux设置: https://code.visualstudio.com/docs/ CPP/Config-Linux 首先。尝试sudo apt install gdb
。I had the same problem: only a "gdb (launch)" option appeared, while documentation says option "g++ build and debug active file" should appear.
In my case it was because the debugger
gdb
was not installed on my system at all. I had neglected to follow linux setup: https://code.visualstudio.com/docs/cpp/config-linux first. Trysudo apt install gdb
.事实证明,这实际上是C/C ++扩展的最新版本(1.9.7)中的一个错误。
当我降级到v1.8.4时,添加运行配置没有问题。
It turns out it is actually a bug in the latest version (1.9.7) of C/C++ extension.
When I downgrade the to v1.8.4 there is no problem adding run configuration.