【发布时间】:2021-06-28 05:20:36
【问题描述】:
我正在运行 Ubuntu MATE 并使用 C++ 编程。我想转移到 vscode 所以我安装了它。但总的来说,我不能真正编译或调试任何东西。这适用于终端运行代码。
g++ HelloWorld.cpp -o HelloWorld.o
./HelloWorld.o
但是如果我想通过按钮编译这个东西happens。我该怎么办?我在下面添加了 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": "cpp - Build and debug active file",
"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
}
],
"preLaunchTask": "C/C++: cpp build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
【问题讨论】:
标签: c++ linux visual-studio-code compiler-errors compilation