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?

UPDATE

The whole file:

CFLAGS  = -g
CC      =  gcc

file.o: file.c file.h
    $(CC) $(CFLAGS) -c file.c
link|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
1  
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
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.