Makefile or Cygwin....

Discussion in 'iOS Development' started by gojohnnyboi, Jun 27, 2008.

  1. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Sorry to post another thread, but i am not risking getting banned for double posting..

    Ok, so i rebuilt cygwin and it started giving me these errors. My makeifle seems perfect... i even used both of skylars examples (bluetooth, tutorial) to test. would somebody please tell me why cygwin will not compile right?


    Code:
    make : cc : command not found

    my makefile:
    Code:
    CC= arm-apple-darwin-gcc
    LD=$(CC)
    LDFLAGS=	-lobjc -framework UIKit -framework Foundation -framework CoreFoundation -framework GrapicsServices
    App=App
    
    all:	$(App)
    
    $(App):		main.o App.o
    	$(LD) $(LDFLAGS) -o $@ $^
    
    
    %.o:	%.m
    	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    
    
    clean:
    	rm -f *.o $(App)
    very basic basic makefile. so what is the problem?


    thanks so much for whomever answers
  2. optimo

    optimo New Member

    Joined:
    Sep 28, 2007
    Messages:
    535
    Likes Received:
    17
    you need the full path for cc
    CC=/usr/local/bin/arm-apple-darwin-gcc

    alternatively, you could modify your PATH variable in bash/cygwin to include CC=/usr/local/bin
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    that does nothing. it's for some reason, is messing up here i believe


    Code:
    %.o:	%.m
    		$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    i dont know what's wrong, as i have compiled this app before, cygwin just now started acting akward when i reinstalled it. i reinstalled it again a few minutes ago, and still, error.
  4. Spreche

    Spreche Member

    Joined:
    Dec 27, 2007
    Messages:
    164
    Likes Received:
    0
    Device:
    iPhone
    I'm getting the same error. The makefile I used was the one from your AppCreator.

    Code:
    CC=arm-apple-darwin-gcc
    LD=$(CC)
    LDFLAGS=	-lobjc -framework UIKit -framework Foundation -framework CoreFoundation 
    App=App
    
    all:	$(App)
    
    $(App):		main.o App.o
    	$(LD) $(LDFLAGS) -o $@ $^
    
    
    %.o:	%.m
    	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    
    
    clean:
    	rm -f *.o $(App)
    Then I replaced that makefile with this one from your very first AppCreator you showed on the ToolChain section.

    Code:
    CC=arm-apple-darwin-gcc
    LD=$(CC)
    LDFLAGS=	-lobjc -framework UIKit -framework Foundation -framework CoreFoundation 
    App=App
    
    all:	$(App)
    
    $(App):		main.o App.o
    	$(LD) $(LDFLAGS) -o $@ $^
    
    
    %.o:	%.m
    	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    
    
    clean:
    	rm -f *.o $(App)
    The weird thing is they look exactly the same. I couldn't find a difference. This makefile above was the one that worked for me.
  5. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
  6. optimo

    optimo New Member

    Joined:
    Sep 28, 2007
    Messages:
    535
    Likes Received:
    17
    makefile is sensitive to tabs, so perhaps the line LDFLAGS= should not have a tab after it. it should be one or more spaces. also check anywhere there is what looks like a tab

    check that out, maybe one text editor changed it into spaces or versa-visa?

    to double check the otherwise, you should be able to launch cygwin, and from the prompt just type:
    Code:
    arm-apple-darwin-gcc
    it should come back saying "no input files", and yo know it's calling the gcc...
  7. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    fixed.

    problem #1: INVISIBLE CHARACTERS
    problem #2: i needed to do /usr/bin/.... for the gcc

    =D

Share This Page