Search code examples
gcccompilationwindows-10mingw32libgcrypt

“cc: command not found” when running make for libgcrypt on windows 10


G'day all. Just to preface this, I'm not an experienced programmer, so I might not use the correct jargon.

I'm in the process of installing GnuPG 2.2.19 on a Windows 10 machine (build no. 18363.628). I have installed MinGW (version 2013072300 according to mingw-get), as well as npth 1.6 and libgpg-error 1.37. I'm now attempting to install libgcrypt 1.8.5. Running ./autogen.sh --build-w32 works, but running make fails with the following output (I am using msys.bat as my shell):

$ make

make  all-recursive

make[1]: Entering directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5'

Making all in compat

make[2]: Entering directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5/compat'

make[2]: Nothing to be done for 'all'.

make[2]: Leaving directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5/compat'

Making all in mpi

make[2]: Entering directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5/mpi'

make[2]: Nothing to be done for 'all'.

make[2]: Leaving directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5/mpi'

Making all in cipher

make[2]: Entering directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5/cipher'

cc -o gost-s-box ./gost-s-box.c

make[2]: cc: Command not found

make[2]: *** [gost-s-box] Error 127

make[2]: Leaving directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5/cipher'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory '/c/Users/USER/Downloads/libgcrypt-1.8.5.tar/libgcrypt-1.8.5/libgcrypt-1.8.5'

make: *** [all] Error 2

Unfortunately I accidentally closed the shell window after the first time I ran make, so this is from when I ran it a second time, hence the "Nothing to be done" stuff.

I have checked the Makefile for libgcrypt; it contains the following:

  • CC = mingw32-gcc

  • CCAS = mingw32-gcc

  • CCASDEPMODE = depmode=gcc3

  • CCASFLAGS = -g -O2

  • CCDEPMODE = depmode=gcc3

  • CC_FOR_BUILD = cc

I've checked the MinGW root folder, and gcc.exe and mingw32-gcc.exe are both present in the bin folder. I've also tried changing the first of those lines above to CC=gcc; no change.

Anyone have any suggestions as to what the problem is? Thanks in advance.


Solution

  • Ok, so I managed to solve it myself; after some research, I found that creating a symlink "CC.exe" to "mingw32-gcc.exe" in MinGW's bin did the trick.