Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in make command makefile:18: *** missing separator. Stop [duplicate]

For the following make file copied below, I am getting the missing separator error. Nothing seems to be wrong with the tabspace.

OBJS = driver.o snapshot.o SHOBJS = malloc.o mymemory.o CC = g++ DEBUG = -g CFLAGS = -Wall -c $(DEBUG) LFLAGS = -Wall $(DEBUG) Snapshot: $(OBJS)   $(CC) $(LFLAGS) $(OBJS) -o Snapshot driver.o: snapshot.h driver.cpp   $(CC) $(CFLAGS) driver.cpp snapshot.o: mymemory.h snapshot.h snapshot.cpp   $(CC) $(CFLAGS) snapshot.cpp libmymemory.so: $(SHOBJS)   gcc -shared -o libmymemory.so malloc.o mymemory.o malloc.o: malloc.c   gcc -fPIC -g -c -Wall malloc.c mymemory.o: mymemory.cpp  gcc -fPIC -g -c -Wall mymemory.cpp  clean:  \rm *.o *~ Snapshot 
like image 681
subramanian Avatar asked Apr 10 '12 22:04

subramanian


People also ask

What is missing separator error in makefile?

Means that the makefile contains spaces instead of Tab's. The make utility is notoriously picky about the use of Space instead of Tab . So it's likely that the makefile contains Space at the beginning of rule stanzas within the file.


1 Answers

Line 18 is gcc -fPIC -g -c -Wall mymemory.cpp. Make is expecting a separator, typically :. It's not detecting this line as a command. You mistyped the intendation: you have spaces where you should have a tab.

Good editors highlight makefile lines that begin with spaces but look like they should begin with a tab instead.

like image 194
Gilles 'SO- stop being evil' Avatar answered Oct 29 '22 13:10

Gilles 'SO- stop being evil'