#-bash gcc command not found error

1 messages · Page 1 of 1 (latest)

oblique zephyr
#

hello, im trying to run my code for one of my assignments and i keep getting this statement "-bash: gcc: command not found". I'm not sure how to fix this. I am also using geany to write my code.

hidden gull
#

Did you make sure to install it first?

#

Also, do you know if you need mingw64 or would ucrt64 be fine or do you not know?

oblique zephyr
#

yes i think i installed it, i need mingw64

#

actually i dont think i installed it

hidden gull
#

then you need to run pacman -S mingw-w64-x86_64-gcc

sick void
#

Same error, Win11, updated, after installing the ming with pacman the path is not set.

#

And this instruction is on the main page of the msys website, I expect at least to work as they state.

regal badger
#

you didn't read the instructions properly

#

the gcc package is not the same as mingw-w64-x86_64-gcc is not the same as mingw-w64-ucrt-x86_64-gcc etc
and you need to be in the matching msys2 environment

sick void
#

I should say I am now intimidated for all what is needed, but, I'm just following the instructions on the web portal for a clean installation...

#

I appreciate you are providing help, but It don't make sense. The web portal has very simple installation instructions for MSYS

#

I will explain step by step what I am doing, based on my reading of the web portal

#

1-Download the installer: msys2-x86_64-20230318.exe, run the installer.

#

2-Accept defaults, it goes to C:\msys64

#

3-The terminal windows open at the end of the installation.

#

4-type pacman -S mingw-w64-ucrt-x86_64-gcc into the console, hit Y when prompted

#

it installs properly

regal badger
#

and are you in the ucrt terminal?

sick void
#

5-following the instructions in clear on the portal type $ gcc --version just to check the program... bam! not found

#

so... the main page, the portal, it just give me trash instructions...

regal badger
#

no, you just need to read it carefully

sick void
#

the window that opens is UCRT, but the instructions tell you to run gcc .... it will never run, it was never downloaded

#

the one that downloaded was g++.exe

#

I think there is little room for interpretation ....

#

Now you can call gcc to build software for Windows.

$ gcc --version
gcc.exe (Rev1, Built by MSYS2 project) 12.2.0

regal badger
#

so /ucrt64/bin/g++.exe exists but /ucrt/bin/gcc.exe does not?

sick void
#

both exists.

#

g++ and gcc.exe exist ...

#

under C:\msys64\ucrt64\bin

regal badger
#

and what does which gcc print?

sick void
#

i don't know, I can't run it from inside the uscrt terminal ...

regal badger
#

yes you can

sick void
#

I see it on the Windows File manager,

#

Ok, if there is another guide that explains what to do I am willing to read

regal badger
#

in my case i do not have ucrt gcc installed as i don't use this env, but in mingw64 i do

sick void
#

good

regal badger
#

it should print /ucrt64/bin/gcc for you

sick void
#

Pedro Farías@MXTJMPLAPA1007 MINGW64 /
$ which gcc
which: no gcc in (/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

Pedro Farías@MXTJMPLAPA1007 MINGW64 /

regal badger
#

you said you were in the ucrt terminal

#

you are clearly not

sick void
#

it is .... 😦 😦

regal badger
#

your prompt says MINGW64

sick void
#

You are right.

#

off course, i am not.

regal badger
sick void
#

I was on the first menu, msys2 64bit

#

now I closed that and went into UCRT x64, and there is

regal badger
#

the latest msys2 installer should have opened a ucrt terminal by default

sick void
#

Pedro Farías@MXTJMPLAPA1007 UCRT64 ~
$ gcc --version
gcc.exe (Rev2, Built by MSYS2 project) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

#

finally

#

It works now, I don't know how, but it works

#

Thank you.

regal badger
sick void
#

I will

#

Good reading.

#

Do you have worked with Raspberri PICO?