Set the environment variable path as C:\msys64\ucrt64\bin in case if you have installed gcc using pacman -S mingw-w64-ucrt-x86_64-gcc.
OR
You can install gcc using: pacman -S mingw-w64-x86_64-gcc and set environment variable path as C:\msys64\mingw64\bin.
Answer from Shiv Buyya on Stack OverflowMaybe simple...
sudo apt-get install gcc
... could be enough?
Do this: open a terminal and type gcc --version. Does anything come up?
Alternatively, search for the gcc executable, which should be located in /usr/bin.
Do ls /usr/bin | grep gcc. What output do you get from that command?
If you get no output from either command, then you need to find your gcc executable wherever you installed it (somewhere in /usr/share maybe?). When found, do cd /usr/bin && ln -s [ABSOLUTE PATH OF GCC].
If you got no output from the first, but output from the second, then you have serious trouble, because /usr/bin is not in your PATH. Edit the file /etc/environment and ADD the following line to the end of the document: PATH="$PATH:/usr/bin".
If you got output from the first, then there is a problem somewhere with bash not reading its own PATH. I think hell would freeze before the first works, but watch you prove me wrong and freeze hell for me. :)
Hope this helps! +1 me if it does!
bash: gcc command not found - Apple Community
GCC not found
gcc installed successfully but its Command not found | The FreeBSD Forums
Can't seem to make MSYS2 GCC work at all
Videos
While installing vmware this error popup gcc not found. How to tackle it
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
Hello, when i enter
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h
at gcc-10.2.0 i get the error message:
bash: x86_64-lfs-linux-gnu-gcc: command not found dirname: missing operand Try 'dirname --help' for more information bash: /install-tools/include/limits.h: No such file or directory
I tried re-making everything in chapter 5.3 and got the error (at the make process): [Makefile:12848: configure-target-libcc] Error 1 and [Makefile:945: all] Error 2.
Any ideas?
