/bin/sh: cc: command not found

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 #-mwindows

I get an error:

/bin/sh: cc: command not found
make: ***[runScript.exe] Error 127

Will appreciate a solution to this.

1

2 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.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like