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 Overflowthe 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
Videos
Hi,
I have installed gcc in Windows 11 environment, but I want to execute gtk, I searched the following link:
https://www.msys2.org/
I installed msys2-x86_64-2025221.exe
After that I tried the following command:
pacman -S mingw-w64-ucrt-x86_64-gcc
but finally gcc is not working please guide me.
The output is:
MSYS ~
$ pacman -S mingw-w64-ucrt-x86_64-gcc
resolving dependencies...
looking for conflicting packages...
Packages (16) mingw-w64-ucrt-x86_64-binutils-2.44-1
mingw-w64-ucrt-x86_64-crt-git-12.0.0.r576.g49111ba98-1
mingw-w64-ucrt-x86_64-gcc-libs-14.2.0-3 mingw-w64-ucrt-x86_64-gettext-runtime-0.24-1
mingw-w64-ucrt-x86_64-gmp-6.3.0-2
mingw-w64-ucrt-x86_64-headers-git-12.0.0.r576.g49111ba98-1
mingw-w64-ucrt-x86_64-isl-0.27-1 mingw-w64-ucrt-x86_64-libiconv-1.18-1
mingw-w64-ucrt-x86_64-libwinpthread-git-12.0.0.r576.g49111ba98-1
mingw-w64-ucrt-x86_64-mpc-1.3.1-2 mingw-w64-ucrt-x86_64-mpfr-4.2.1-2
mingw-w64-ucrt-x86_64-windows-default-manifest-6.4-4
mingw-w64-ucrt-x86_64-winpthreads-git-12.0.0.r576.g49111ba98-1
mingw-w64-ucrt-x86_64-zlib-1.3.1-1 mingw-w64-ucrt-x86_64-zstd-1.5.7-1
mingw-w64-ucrt-x86_64-gcc-14.2.0-3
Total Download Size: 65.83 MiB
Total Installed Size: 519.08 MiB
:: Proceed with installation? [Y/n] Y
:: Retrieving packages...
mingw-w64-ucrt-x86_64-gcc-... 43.5 MiB 14.3 MiB/s 00:03 [###############################] 100%
mingw-w64-ucrt-x86_64-isl-... 1453.5 KiB 420 KiB/s 00:03 [###############################] 100%
mingw-w64-ucrt-x86_64-libi... 725.4 KiB 930 KiB/s 00:01 [###############################] 100%
mingw-w64-ucrt-x86_64-gcc-... 1021.6 KiB 823 KiB/s 00:01 [###############################] 100%
mingw-w64-ucrt-x86_64-zstd... 642.3 KiB 2.55 MiB/s 00:00 [###############################] 100%
mingw-w64-ucrt-x86_64-gmp-... 578.5 KiB 963 KiB/s 00:01 [###############################] 100%
mingw-w64-ucrt-x86_64-mpfr... 535.7 KiB 1739 KiB/s 00:00 [###############################] 100%
mingw-w64-ucrt-x86_64-mpc-... 128.3 KiB 594 KiB/s 00:00 [###############################] 100%
mingw-w64-ucrt-x86_64-gett... 311.6 KiB 499 KiB/s 00:01 [###############################] 100%
mingw-w64-ucrt-x86_64-zlib... 92.1 KiB 165 KiB/s 00:01 [###############################] 100%
mingw-w64-ucrt-x86_64-winp... 39.8 KiB 128 KiB/s 00:00 [###############################] 100%
mingw-w64-ucrt-x86_64-binu... 6.0 MiB 994 KiB/s 00:06 [###############################] 100%
mingw-w64-ucrt-x86_64-head... 6.4 MiB 1046 KiB/s 00:06 [###############################] 100%
mingw-w64-ucrt-x86_64-libw... 28.6 KiB 97.4 KiB/s 00:00 [###############################] 100%
mingw-w64-ucrt-x86_64-wind... 3.0 KiB 12.9 KiB/s 00:00 [###############################] 100%
mingw-w64-ucrt-x86_64-crt-... 4.6 MiB 679 KiB/s 00:07 [###############################] 100%
Total (16/16) 65.8 MiB 9.35 MiB/s 00:07 [###############################] 100%
(16/16) checking keys in keyring [###############################] 100%
(16/16) checking package integrity [###############################] 100%
(16/16) loading package files [###############################] 100%
(16/16) checking for file conflicts [###############################] 100%
(16/16) checking available disk space [###############################] 100%
:: Processing package changes...
( 1/16) installing mingw-w64-ucrt-x86_64-libwinpthread-git [###############################] 100%
( 2/16) installing mingw-w64-ucrt-x86_64-gcc-libs [###############################] 100%
( 3/16) installing mingw-w64-ucrt-x86_64-libiconv [###############################] 100%
( 4/16) installing mingw-w64-ucrt-x86_64-gettext-runtime [###############################] 100%
( 5/16) installing mingw-w64-ucrt-x86_64-zlib [###############################] 100%
( 6/16) installing mingw-w64-ucrt-x86_64-zstd [###############################] 100%
( 7/16) installing mingw-w64-ucrt-x86_64-binutils [###############################] 100%
( 8/16) installing mingw-w64-ucrt-x86_64-headers-git [###############################] 100%
( 9/16) installing mingw-w64-ucrt-x86_64-crt-git [###############################] 100%
(10/16) installing mingw-w64-ucrt-x86_64-gmp [###############################] 100%
(11/16) installing mingw-w64-ucrt-x86_64-isl [###############################] 100%
(12/16) installing mingw-w64-ucrt-x86_64-mpfr [###############################] 100%
(13/16) installing mingw-w64-ucrt-x86_64-mpc [###############################] 100%
(14/16) installing mingw-w64-ucrt-x86_64-windows-default... [###############################] 100%
(15/16) installing mingw-w64-ucrt-x86_64-winpthreads-git [###############################] 100%
(16/16) installing mingw-w64-ucrt-x86_64-gcc [###############################] 100%
zulfi@DESKTOP-070V6RM MSYS ~
$ gcc --version
-bash: gcc: command not foundHowever, gcc is already working on my computer on windows shell,
c:\msys64>gcc gcc: fatal error: no input files compilation terminated.
I want to install gtk.
Somebody please guide me.
Zulfi.
Since you installed mingw-w64-x86_64-gcc it seems like you want to compile 64-bit native Windows applications. Therefore, you should start MSYS2 by running mingw64.exe, found at the top level of your MSYS2 installation. That will put /mingw64/bin/ on your PATH and set some other useful environment variables.
Solution
I have found simply adding C:\msys64\mingw64\bin to the host windows computers PATH variable this, in turn, adds \mingw64\bin to the MSYS2 $PATH solving the problem.
Unable to resolve configuration with compilerPath "gcc". Using "C:\MinGW\bin\gcc.exe" instead. (this is visual studio code ide)
I tried to compile a default key map and get the error message "sh: avr-gcc: comand not found".
When using make iris/rev2:default following error message appeared.
$ make iris/rev2:default QMK Firmware 0.6.246 Making iris/rev2 with keymap default /bin/sh: avr-gcc: command not found sh: avr-gcc: command not found sh: avr-gcc: command not found make[1]: *** [tmk_core/rules.mk:256: gccversion] Error 127 Make finished with errors make: *** [Makefile:544: iris/rev2:default] Error 1
I use windows10 and Msys2 64bit with "MSYS2 MinGW 64-bit".
I tried following to solve this error, but didn't solve the problem.
reinstall msys2 and qmk
rerun util/qmk_install.sh
run echo 'export PATH="/usr/local/opt/avr-gcc@7/bin:$PATH"' >> ~/.bash_profile and restart terminal
run pacman -S avr-gcc and "Error target not found: avr-gcc" appeared.
This is my first time of building key map, then I'm a beginner.
Any information would greatly help.
Here is a link I found that solves this exact issue by modifying a line in the fstab.sample file (in my case this is the name). To summarize, add mount to the following line in fstab.sample like this
c:/MinGW/ /mingw // Suggested* default line
mount c:/MinGW/ /mingw // Fixed the "gcc:command not found" error for me
*Suggested by MinGW/MSYS installation guide and seems to be present by default in the file these days. This is an alternative solution and modifying path variables works.
Right Click on Computer. Properties. Advanced Settings. Add a new path to path variable. It should be the place of bin.
