I am running MingW32 on Windows 10. When I try to compile my programme using the command:
$ make -f Makefile
cc -g -Wall -o runScript.exe abc.o def.o ghi.o -lgdi32 -lcomdlg32 #-mwindowsI get an error:
/bin/sh: cc: command not found
make: ***[runScript.exe] Error 127Will appreciate a solution to this.
12 Answers
The trick with Makefile not finding cc when using gcc is usually setting CC=gcc.exe (and if needed CXX=g++.exe, you can also specify the full path if you like) either as environment variables or on the make command line like this: make CC=gcc.exe (you shouldn't really need to add -f Makefile as that's the default).
Thanks for you comments. It gave me direction. MinGW doesn't come with cc so instead of defining it to gcc as an environment variable, I used an easy option making a copy of g++.exe to cc.exe in C:\MinGW\bin. Its working now.