user3162234
user3162234

Reputation: 11

*** missing separator. Stop. Make file in c

I'm getting this error:

make:7: *** missing separator.  Stop.

Line7:

$(CXX) -o $(TARGET) $(OBJS) $(LIBS)

Here is the code:

CXXFLAGS =  -O2 -g -Wall -fmessage-length=0
OBJS =      main.c
LIBS =
TARGET =      main.exe

$(TARGET):  $(OBJS)
    $(CXX) -o $(TARGET) $(OBJS) $(LIBS)
all:    $(TARGET)
clean:
    rm -f $(OBJS) $(TARGET)

Upvotes: 1

Views: 1462

Answers (1)

suspectus
suspectus

Reputation: 17258

The target actions must have an initial TAB character - not spaces.

$(TARGET):  $(OBJS)
    $(CXX) -o $(TARGET) $(OBJS) $(LIBS)

^^^^
TAB
clean:
    rm -f $(OBJS) $(TARGET)
^^^^
TAB

Upvotes: 1

Related Questions