I first installed mingw into my system and added it to the path. It worked. Showing version when I type gcc --version in cmd. Then I reinstalled VS Code, then i
gcc --version