tags:

views:

34

answers:

1

Hello i have instlled cygwin in my system.But when i try to use gcc command it is saying

bash: gcc: command not found

can any one please provide me the solution please.

+1  A: 

A couple of things:

  • I always install the whole Cygwin package. Earlier versions had troubles with dependencies that are fixed now, I believe, but it's still a good habit. You never know when you may need the most esoteric bit of Cygwin.

  • You may have to change your path. All the tools can generally be found okay if you're running inside the Cygwin bash shell but that's not necessarily the case from cmd.exe.

It's unlikely to be that last one since your error message is coming from bash itself, so I'm pretty certain that's how you're running it.

Have a look to make sure you have /usr/bin/gcc from within bash and that your path includes /usr/bin somewhere:

pax> echo $PATH
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS

pax> which gcc
/usr/bin/gcc

If it's not there, go back and re-install everything (or the relevant development package if you don't want everything). If it is there and your path doesn't have its location, change your path, in either /etc/profile or the equivalent in your home directory.

paxdiablo