1

Screenshot of error that I get

The term 'gcc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I have the code runner and C/C++ packs installed. But for some reason, I always get an error similar to this regardless of what I try to do. I've tried reinstalling VSCode, but that didn't fix anything.

5
  • Do you have a compiler installed?
    – gronostaj
    Commented Feb 24, 2023 at 18:39
  • 1
    GCC is clearly not in your path. You probably don't have it. VSCode simply SHELLS to the stuff you already have. Support for your "code runner?" and C/C++ isnt "Install GCC and everything else it needs.". If you can't build at the command line (without VSCode), then VSCode won't succeed either. Commented Feb 24, 2023 at 18:46
  • Thanks, I didnt realize that you needed a compiler. I thought it worked like visual studio 2022.
    – Theo 17
    Commented Feb 24, 2023 at 18:59
  • Nope.. I know you get it now. VS2022 comes with one.. VSCode does not. Good luck! :) Commented Feb 24, 2023 at 19:08
  • See C/C++ for Visual Studio Code for an example on how to add a compiler.
    – harrymc
    Commented Feb 24, 2023 at 19:24

1 Answer 1

0

You need to install GCC (or whichever C/C++ compiler you want to use) and put the directory containing it in your system PATH (usually this is done for you by the installer program / package manager).

Unlike Visual Studio, VS Code does not come with a compiler.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .