I have two gcc's installed in cygwin right now: i686-w64-mingw32-gcc-4.5.3.exe and the cygwin gcc. Ill show you what I did for the sake of clarity:
$ ls -al /usr/bin/gcc* lrwxrwxrwx 1 User None 21 Aug 16 13:15 /usr/bin/gcc.exe -> /etc/alternatives/gcc -rwxr-xr-x 2 User None 94741 Feb 25 2009 /usr/bin/gcc-3.exe $ ls -al /etc/alternatives/gcc* lrwxrwxrwx 1 User None 18 Aug 16 13:15 /etc/alternatives/gcc -> /usr/bin/gcc-3.exe $ rm /etc/alternatives/gcc $ ln -S /usr/bin/i686-w64-mingw32-gcc-4.5.3.exe /etc/alternatives/gcc $ gcc -v Using built-in specs. COLLECT_GCC=gcc Target: i686-w64-mingw32 Configured with: /cygdrive/i/szsz/tmpp/32gcc/mingw64-i686-gcc-4.5.3-6/src/gcc-4.5.3/configure --srcdir=/cygdrive/i/szsz/tmpp/32gcc/mingw64-i686-gcc-4.5.3-6/src/gcc-4.5.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/mingw64-i686-gcc -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-w64-mingw32 --with-sysroot=/usr/i686-w64-mingw32/sys-root --with-build-sysroot=/usr/i686-w64-mingw32/sys-root --disable-multilib --disable-win32-registry --enable-languages=c,ada,c++,fortran,objc,obj-c++ --enable-fully-dynamic-string --enable-libgomp --enable-sjlj-exceptions --enable-version-specific-runtime-libs --with-dwarf2 --enable-decimal-float=bid --enable-lto Thread model: win32 gcc version 4.5.3 (GCC) $ gcc -o test test.c gcc: error trying to exec 'cc1': execvp: No such file or directory $ /usr/bin/i686-w64-mingw32-gcc.exe -o test test.c $
How do I get gcc to work?