facing problem in running code on vs code editor

subham kumar 0 Reputation points
2025-12-18T19:55:18.7066667+00:00

when i run my first code on vs code editor , it shows error like your mingw compiller doesn't properly installed but i did everything that i know about it .
there is screen shot i pasted below :-
Screenshot 2025-12-19 010833

i'm in too much trouble ..
please solve my this problem

Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 69,125 Reputation points MVP Volunteer Moderator
    2025-12-18T19:59:56.7966667+00:00

    This usually means that VS Code cannot find the gcc compiler executable, even if you have installed MinGW. Here’s how to fix it step by step:

    1. Verify MinGW Installation

    Make sure you installed MinGW and included the gcc compiler.

    Typically, MinGW is installed in:

    C:\MinGW\bin
    

    Open a Command Prompt (not VS Code) and type:

    gcc --version
    

    If it shows the version, MinGW is installed correctly.

    If it says 'gcc' is not recognized, the PATH is not set.

    1. Add MinGW to Environment Variables

    Press Win + S → search Environment Variables → “Edit the system environment variables”.

    Click Environment Variables → under System Variables, find Path → Edit.

    Add the path to your MinGW bin folder, e.g.:

    C:\MinGW\bin
    

    Click OK and restart VS Code.

    1. Check Your VS Code Terminal

    In VS Code terminal, type:

    gcc --version
    

    If it now shows the version, you’re ready to compile.

    1. Compile Your C Code

    In the terminal, run:

    gcc Hello.c -o Hello.exe
    .\Hello.exe
    

    Avoid using ; if ($?) { ... } unless you know PowerShell scripting.

    If you’re using PowerShell, just compile and run separately:

      gcc Hello.c -o Hello .\Hello
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.