4

I'm about to start learning C and chose VS Code with GCC as my compiler. I added a hello world program to test it out and I get the following popup:

enter image description here

I have zero experience with any of this so I would greatly appreciate the help. I followed the Open launch.json option and did not understand how that was relevant to my problem. It gave me the following:

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "(Windows) Launch",
        "type": "cppvsdbg",
        "request": "launch",
        "program": "enter program name, for example ${workspaceFolder}/a.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false
    }
]

}

I have no clue what to do. I tried looking through StackOverflow for similar problems and have had no success.

VeryNiceCoat
  • 69
  • 1
  • 1
  • 6

2 Answers2

2

Regarding this post:

Q: What is the difference between * when it come before and after something in C?

A: Look at the ""right-left" rule:

Regarding this question:

Q: Why am I getting “launch:program does not exist” in VS Code?

A: If you look carefully, the actual error is launch: program "" does not exist

In other words, VSCode was looking for some program named "" (empty string), and not finding it.

You simply need to configure your environment (including, as you discovered, the runner), and define everything (especially "program") correctly in your launch.json.

FoggyDay
  • 11,962
  • 4
  • 34
  • 48
0

After installing .net runner the problem was solved at my end.

Justicle
  • 14,761
  • 17
  • 70
  • 94