error trying to exec 'as': execvp: No such file or directory

Steven Penny picture Steven Penny · Apr 23, 2012 · Viewed 10.5k times · Source

When trying to build I get this error:

$ make CC=i686-w64-mingw32-gcc
  CC    aes.c
i686-w64-mingw32-gcc: error trying to exec 'as': execvp: No such file or directory

Answer

Steven Penny picture Steven Penny · Apr 23, 2012

Set PATH to /usr/bin instead of /bin

There is a known caveat where calling the compiler directly as /bin/x86_64-w64-mingw32-gcc will fail, use /usr/bin/x86_64-w64-mingw32-gcc instead and make sure that your PATH variable has /usr/bin before /bin.

mingw-w64.sourceforge.net

This is caused by a mounting problem. On linux you have /bin and /usr/bin, no big deal. On Cygwin you have C:\cygwin\bin. Then mount points are set like this.

C:\cygwin\bin on /usr/bin
C:\cygwin on /

So technically you could represent C:\cygwin\bin with /bin or /usr/bin, although as stated above the former will not work.