Das Debugging konnte nicht gestartet werden. Der Programmpfad '/ home/student/Dokumente/Visual Studio Code/Rechteck' fehlt oder ist ungültig.C++ für VS-Code: Debugging kann nicht gestartet werden - Programmpfad fehlt oder ist ungültig
sieht mein launch.json wie folgt aus:
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"miDebuggerPath": "/usr/bin/gdb",
"targetArchitecture": "x64",
"program": "${workspaceRoot}/rectangle",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": []
},
{
"name": "C++ Attach (GDB)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"miDebuggerPath": "/usr/bin/gdb",
"targetArchitecture": "x64",
"program": "${workspaceRoot}/rectangle",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": []
}
]
}
Meine C++ Programm ist dies:
#include <iostream>
using namespace std;
int main()
{
double length, width, area;
cout << "Enter the length: ";
cin >> length;
cout << "Enter the width: ";
cin >> width;
area = length * width;
cout << "The area is " << area << endl;
return 0;
}
Sie haben uns eine Menge Informationen zur Verfügung gestellt, aber ... Was ist mit dem Programmpfad '/ home/student/Dokumente/Visual Studio Code/Rechteck', der fehlt oder ungültig ist? Können Sie überprüfen, ob ein solcher Pfad existiert? :-) –
Ja, schau dir das "print working directory" Ergebnis meines Pfades an: [student @ rhel7 Visual Studio-Code] $ pwd /home/student/Dokumente/Visual Studio-Code [Student @ Rhel7 Visual Studio Code] $ ls -l Rechteck -rw-rw-r--. 1 Student Student 287 24. Mai 13:27 Rechteck –