Skip to content
Advertisement

How can I set up launch.json in Visual Code to debbug C

I’m newbie about Visual Code. I’d like to use Debbuging function with Visual Code. But There is a probelm to do it. It may happen by wrong launch.json setting(In my opnion)

I’m using mac os newest version.

I refered to some pages to do it myself.

https://code.visualstudio.com/docs/languages/cpp

https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md

https://code.visualstudio.com/docs/python/debugging

However I saw same error. It said “launch: program ‘${/Users/bpk/Documents/Study/C/Study}/study’ does not exist”

This is my launch.json file below

JavaScript

Upper message is debug console log from visual code

Thanks to read my first question!

Advertisement

Answer

I think you are mixing up variables and strings ${...} indicates a variable used within visual code. Directory paths don’t need the encompassing ${}.

Your Python3 configuration should look like this:

JavaScript

Changes to your C debug configuration are much the same as Python and should look like this:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement