You can install gcc by running setup-x86.exe or setup-x86_64.exe again. The gcc package is in the Devel category:

Answer from David L. on Stack Overflow
Discussions

Can't seem to make MSYS2 GCC work at all
I know this doesn’t answer your question, but I struggled a lot with getting it all set up as well. I found it much easier to just install WSL and I can open that in a terminal window inside of VSCode and compile all my C or C++ programs. If you absolutely need to get MYSYS2 working, good luck. I’ll be checking back on this thread. More on reddit.com
🌐 r/learnprogramming
15
1
June 4, 2023
windows - gcc is recognized by cmd, but not by bash - Stack Overflow
I'm using windows sub-system for linux, installed ubuntu, and bash is running smoothly. I'm trying to use make, and it seems that bash doesn't recognize gcc. Tried adding it to PATH, but nothing ch... More on stackoverflow.com
🌐 stackoverflow.com
November 29, 2021
/bin/sh: gcc: command not found
I ran your script from powershell, starting with the .\build_locally_fdk_aac_32_bit_fast.bat, but I am seeing this error. I am on Windows 8. /bin/sh: gcc: command not found When I open local instal... More on github.com
🌐 github.com
5
October 31, 2015
Why does the gcc command not work on Windows command line, but works on Git Bash? - Stack Overflow
I have added C:\MinGW\bin to my user path, and I made sure that gcc.exe exists in the C:\MinGW\bin folder. When I run this I get: gcc -- version 'gcc' is not recognized as an internal or exte... More on stackoverflow.com
🌐 stackoverflow.com
January 12, 2018
🌐
Stack Overflow
stackoverflow.com › questions › 61713451 › using-git-bash-unable-to-compile-c-code-gcccommand-not-found
Using Git Bash unable to compile C code: "gcc:command not found" - Stack Overflow
Possible duplicate of this stackoverflow.com/questions/25705726/… ... I was having a similar problem - assuming you are using windows, make sure your downloaded MinGW folder is in your GIT folder (C:\Program Files\Git\MinGW).
🌐
Delft Stack
delftstack.com › home › howto › linux › solve gcc command not found error in bash
How to Solve GCC Command Not Found Error in Bash | Delft Stack
March 11, 2025 - For example, if GCC is located in /usr/local/bin/gcc, you would add the following line to your .bashrc or .bash_profile: ... Now, try running the gcc --version command again. If everything is set up correctly, you should see the version number without any errors. Encountering the “gcc command not found” error in Bash can be a common hurdle for developers, but it is usually easy to fix.
🌐
GitHub
gist.github.com › alandsilva26 › 53cd2fecf253554c2f671766d3df5d66
Instructions for installing GCC Compiler on Windows · GitHub
April 26, 2026 - Locate your program I will be giving ... from here Download the one that says mingw-setup.exe Make sure that you dont have gcc previously installed in your computer Follow the instructions You will have to set the path manually ...
🌐
Reddit
reddit.com › r/learnprogramming › can't seem to make msys2 gcc work at all
r/learnprogramming on Reddit: Can't seem to make MSYS2 GCC work at all
June 4, 2023 -

the instalation of GCC seemed to work fine, but when i run gcc -- version, i get greeted by "bash:gcc: command not found" response. i followed the instructions with every step. what could be the issue?

I found a fix thanks to chatgpt ( who would've thought). turns out the MSYS2 link from the vs code page was simply outdated, so i used this one from the MSYS2 page and ran the commands in the ucrt window. I will leave this here in hopes someone else finds and needs this

Find elsewhere
🌐
Narkive
cygwin.cygwin.narkive.com › YeOR735g › help-with-using-bash-gcc-installed-but-command-not-found
Help with using Bash / GCC installed but command not found
June 26, 2009 - Until one day I loaded it up and instead of the usual interface I had, it just said bash-3.2$, no username, or directory or anything, and none of the unix commands work. My guess is that your Windows HOME environment variable was set, changed, or unset, either by you or by some program you ran (including setup.exe for some other application). (Vista: Start -> Control Panel -> System -> Advanced System Settings -> Environment Variables.) Over the years, I've found that Cygwin Bash works best when Windows HOME is not set.
🌐
CodeWithHarry
codewithharry.com › blogpost › solved-gcc-not-recognized-error-windows
[Solved] gcc: The term 'gcc' is not recognized as the name of a cmdlet, function... | Blog | CodeWithHarry
At line:1 char:1 + gcc + ~~~~ + ... a cmdlet, function, script file, or operable program." occurs for two primary reasons: Reason 1: Absence of the gcc compiler on your computer....
🌐
Super User
superuser.com › questions › 1745446 › gcc-not-recognized-though-c-mingw-bin-added-to-path
compile - 'gcc' not recognized though C:\MinGW\bin added to path - Super User
October 2, 2022 - Also: cygpath -w $(which gcc) might tell what to put in Windows-based configs (e.g. %PATH%). More 'Linux' stuff... If you have e.g. mlocate installed. $ locate -i "*gcc" /diff/usr/lib/gcc ... /usr/bin/c89-gcc /usr/bin/c99-gcc /usr/bin/gcc /usr/bin/x86_64-linux-gnu-gcc /usr/lib/gcc /usr/share/gcc /usr/share/bash-completion/completions/gcc /usr/share/doc/gcc /usr/share/doc/gcc-8-base/gcc /usr/share/doc/gcc-9-base/gcc /usr/src/linux-headers-5.13.0-52-generic/include/config/CC_IS_GCC /usr/src/linux-hwe-5.13-headers-5.13.0-52/scripts/dummy-tools/gcc
🌐
GitHub
github.com › rdp › ffmpeg-windows-build-helpers › issues › 95
/bin/sh: gcc: command not found · Issue #95 · rdp/ffmpeg-windows-build-helpers
October 31, 2015 - To fix this, i went back to Cygwin setup, and installed a bunch of gcc untill one of them installed gcc.exe into /bin/ of the local install of cygwin. 2015-10-30 22:03:00 (36.3 MB/s) - 'quick_cross_compile_ffmpeg_fdk_aac_using_packaged_mingw64.sh' saved [2507/2507] + host=i686-w64-mingw32 ++ pwd + prefix=/cygdrive/d/tmp/ffmpeg-windows-build-helpers/native_build/ffmpeg_local_builds/sandbox/win32/quick_install/install_root + export PKG_CONFIG_PATH=/cygdrive/d/tmp/ffmpeg-windows-build-helpers/native_build/ffmpeg_local_builds/sandbox/win32/quick_install/install_root/lib/pkgconfig + PKG_CONFIG_PATH=/cygdrive/d/tmp/ffmpeg-windows-build-helpers/native_build/ffmpeg_local_builds/sandbox/win32/quick_install/install_root/lib/pkgconfig + mkdir -p sandbox/win32/quick_install + cd sandbox/win32/quick_install + [[ !
Author   rdp
🌐
Stack Overflow
stackoverflow.com › questions › 48217902 › why-does-the-gcc-command-not-work-on-windows-command-line-but-works-on-git-bash
Why does the gcc command not work on Windows command line, but works on Git Bash? - Stack Overflow
January 12, 2018 - gcc -- version 'gcc' is not recognized as an internal or external command, operable program or batch file. But when I run it on Git Bash, the command executes properly.
🌐
Stack Overflow
stackoverflow.com › questions › 60390138 › gcc-found-but-not-executing-on-windows-git-bash
gcc found but not executing on windows git bash - Stack Overflow
February 25, 2020 - I installed gcc on windows via msys32. On powershell and on command prompt it executes properly. The only strange thing: which gcc yields /usr/bin/gcc, yes with unix slashes. In real world it is installed in ~/AppData/Roaming/msys32/usr/bin so the msys path is cut off. In git bash gcc yields no command not found ...
🌐
Yichaoou
yichaoou.github.io › tutorials › software › 2016 › 06 › 28 › git-bash-install-gcc
How to install gcc in Git Bash (Windows)
June 28, 2016 - Note: Git Bash in Windows cannot behave exactly the same as a linux bash. If you need to do the same in Windows, you may try CygWin. To install GCC, the trick is to install MinGW installation manager.
🌐
Windows Command Line
windows-commandline.com › gcc-not-recognized-internal-external-command
GCC is not recognized as internal or external command
May 21, 2016 - This post explains how to fix the error “Gcc is not recognized as internal or external command” when you are using MingW tools on windows
🌐
Cprogramming
cboard.cprogramming.com › windows-programming › 178077-i-have-installed-cygwin-but-no-gcc-my-command-prompt.html
I have installed Cygwin but no GCC in my command prompt
September 20, 2019 - Make sure you are in the directory where gcc.exe exists || ... How to Add to Windows PATH Environment Variable gcc might not even be installed.
🌐
Bobby Hadz
bobbyhadz.com › blog › gcc-is-not-recognized-as-an-internal-or-external-command
gcc is not recognized as an internal or external command | bobbyhadz
April 4, 2024 - Close your active Command Prompt sessions and start a new session. Try to issue the gcc -version command.
🌐
Edaboard
edaboard.com › eda software › software problems, hints and reviews
gcc is not recognized as an internal or external command | Forum for Electronics
June 16, 2018 - Hello I am trying to install gcc compiler I have downloaded and installed MinGW on windows 10. When I check program it give error Command :gcc -o test test.c program #include int main() { printf("Hello world!"); return 0; } Error gcc is not recognized as an internal or external...