Vscode-cpptools: Program does not exist

Created on 18 Apr 2016  路  4Comments  路  Source: microsoft/vscode-cpptools

on ubuntu 14.04
when trying to debug, causes this error:
launch: program '/home/leon/visual-studio/a01.cpp' does not exist

debugger

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

All 4 comments

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DemoCrazer picture DemoCrazer  路  3Comments

montery8 picture montery8  路  3Comments

vicatcu picture vicatcu  路  3Comments

jheinzel picture jheinzel  路  3Comments

arl picture arl  路  3Comments