gcccygwin

gcc fails with spawn: No such file or directory


I downloaded Ruben’s build of Cygwin GCC.

However upon running it seems unable to compile any files

$ touch foo.c

$ gcc foo.c
gcc: error: spawn: No such file or directory

As a workaround, I found this to work

i686-w64-mingw32-gcc foo.c

Solution

  • I had this same problem on Cygwin64, and the solution was PATH related..kinda.

    Turns out, there are copies of gcc in /usr/bin and /bin (at least, there is in my install).

    Executing /bin/gcc failed with the error above -- I'm guessing due to incorrectly assumed relative paths???

    Executing /usr/bin/gcc works as expected!

    In my case, the "problem" was that I had inadvertently injected "/bin" into my PATH environment variable, resulting in /bin/gcc being executed, instead of /usr/bin/gcc. Removing the "/bin" from the path solved the problem.

    Still unclear why there are two gcc binaries (which appear to be identical) in different places... but maybe the Cygwin gurus can answer that; or maybe my installation is just foo-barred.