Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed Cygwin. My problem is when I try to run a makefile which contains a line

gcc -g -c file.c

I get an error:

Fatal: Unable to execute command: gcc

At the same time when running this command from command line it works fine. What am I doing wrong?


The whole file:

CFLAGS  = -g
CC      =  gcc

file.o: file.c file.h
    $(CC) $(CFLAGS) -c file.c
share|improve this question
Please show the rest of the make file. –  ceving May 8 '11 at 16:54
@ceving I have updated my question –  Max May 8 '11 at 17:19
I thought it could be due to your Makefile having DOS line endings, but I just used your Makefile on my Cygwin installation with DOS line endings and with Unix line endings and it worked fine both ways. –  garyjohn May 8 '11 at 18:59
Are you sure you're using Cygwin make? You can check with which make. –  ak2 May 8 '11 at 19:36
@ak2 Thanks! That was the reason. After I installed cygwin make it worked. –  Max May 8 '11 at 21:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.