I tried to debug C++ file with gdb, but following error message is appeared.
Unable to 'main.cpp': File not found (file:///c/Users/.../main.cpp)
But I set the program path in launch.json file like this:
"program": "C:/Users/.../main.exe"
I think it's because VS Code recognizes C: to c, but I couldn't find any solutions to fix this issue.
How can I set target program's path correctly?
I found solution through asking VS Code GitHub.
If above error message is appeared, add sourceFileMap to launch.json file.
"sourceFileMap": {
"/c": "C:/"
}
https://github.com/Microsoft/vscode-cpptools/issues/1546#issuecomment-365368570
Try to write the path in the launch file as:
"program": "C:\\Users\\..\\main.exe"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With