on ubuntu 14.04
when trying to debug, causes this error:
launch: program '/home/leon/visual-studio/a01.cpp' does not exist
@leoer what does your launch.json file look like?
@johnkemnetz
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"miDebuggerPath": "/usr/bin/gdb",
"targetArchitecture": "x64",
"program": "${workspaceRoot}/a01.cpp",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": []
},
{
"name": "C++ Attach (GDB)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"miDebuggerPath": "/usr/bin/gdb",
"targetArchitecture": "x64",
"program": "${workspaceRoot}/a01.cpp",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"processId": "enter program's process ID"
}
]
}
@leoer My guess is that a01.cpp is the file you want to build into an executable program and debug, yes? If so, you'll need to set up a Tasks.json file that builds the .cpp into an executable program (eg. using gcc) then reference the executable program name (eg. "a.out") from the launch.json "program" property. See the last paragraph here:http://code.visualstudio.com/docs/languages/cpp#_debuggingfor more info on that.
Spend a lot of time
Ideally vs-code can give prompts for each installation, etc. automatically, so that it wont be so long procedure for beginners.
I wrote how to run C++ in vs code in a very detailed manner here:
https://stackoverflow.com/a/50658089/984471
Most helpful comment
Spend a lot of time
Ideally vs-code can give prompts for each installation, etc. automatically, so that it wont be so long procedure for beginners.
I wrote how to run C++ in vs code in a very detailed manner here:
https://stackoverflow.com/a/50658089/984471