0

When trying to run the command make, I am getting the error: makefile:22: *** missing separator. Stop. Line 22 would be the line just before g++ driver.o ground.o... I know I need to use tabs, instead of spaces, but it still does not work. Any idea? This is my code:

LFLAGS = -lglut -lGLU -lGL

a.out:  driver.o ground.o game.o uiInteract.o uiDraw.o point.o lander.o velocity.o 
 g++ driver.o ground.o game.o uiInteract.o uiDraw.o point.o lander.o velocity.o $(LFLAGS)
 tar -j -cf moonLander.tar makefile *.h *.cpp

uiDraw.o: uiDraw.cpp uiDraw.h
 g++ -c uiDraw.cpp

uiInteract.o: uiInteract.cpp uiInteract.h
 g++ -c uiInteract.cpp

point.o: point.cpp point.h
 g++ -c point.cpp

ground.o: ground.cpp ground.h
 g++ -c ground.cpp

game.o: game.h game.cpp uiDraw.h uiInteract.h point.h ground.h
 g++ -c game.cpp

driver.o: driver.cpp game.h uiInteract.h
 g++ -c driver.cpp

lander.o: lander.cpp lander.h point.h velocity.h uiDraw.h
 g++ -c: lander.cpp

velocity.o: velocity.cpp velocity.h
 g++ -c: velocity.cpp

clean:
 rm a.out *.o *.tar
nobody
  • 19,814
  • 17
  • 56
  • 77
  • 2
    i dont know how to mark the thread as duplicate so im just going to comment this here http://stackoverflow.com/questions/18936337/makefile1-missing-separator-stop – Lorence Hernandez Nov 03 '16 at 20:22
  • Thank you very much, I fixed it, it was a text editor problem. – Frank Rincon Nov 03 '16 at 20:27
  • PROBLEM: Makefile requires a "tab". SOLUTION: the link Lorence Hernandez cited: [Makefile:1: *** missing separator](http://stackoverflow.com/questions/18936337/makefile1-missing-separator-stop). Will "close/duplicate". – paulsm4 Nov 03 '16 at 20:37
  • https://stackoverflow.com/questions/16931770/makefile4-missing-separator-stop you can resolve your error from here – Komal Agarwal Oct 30 '20 at 06:48

1 Answers1

1

I can't comment yet, but this appears to be a duplicate of Errors in make file : *** missing separator. Stop
Depending on the editor you are using (and how you've configured that editor), your tabs might be getting replaced with spaces (i.e, when you hit the tab key, it inputs 4 spaces instead).
Either change your editor to use tab characters instead of spaces, or use another editor that is set up that way.

CyanBlob
  • 64
  • 1
  • 7