-
I run ubuntu20.04 on wsl2, and have install clang++-12. After I write a program in VS Code like that: #include <array>
#include <iostream>
using namespace std;
int main() {
auto arr = std::to_array({1, 2, 3, 4, 5, 6});
for (auto val : arr) {
std::cout << val << " ";
}
std::cout << std::endl;
} And I create the launch.json and tasks.json files like that:
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/build/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "build"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "clang++",
"args": [
"${file}",
"-std=c++20",
"-Wall",
"-g",
"-o",
"${workspaceFolder}/build/${fileBasenameNoExtension}"
]
}
]
} I click the debug, but it reports an error:
But when I compile it as follows:
It succeeds. |
Beta Was this translation helpful? Give feedback.
Answered by
ghost
Aug 13, 2021
Replies: 1 comment 2 replies
-
It works when I click the debug next time... |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works when I click the debug next time...
I don't know why?
I think this discussion can be deleted 🤣