c ++ makfile错误:makefile:5:***缺少分隔符。停止

问题描述 投票:0回答:1

我正在尝试在linux中运行我的c ++(用clion编写)程序。当我尝试使用“ make”命令在终端中对其进行编译时,出现以下错误:“ makefile:5:***缺少分隔符。停止。”我已经检查了makefile中是否有选项卡,而不是4个空格。有人有主意吗?谢谢!

这是我的makefile:

CFLAGS := -c -Wall -Weffc++ -g -std=c++11 -Iinclude
LDFLAGS := -lboost_system

all: StompBookClubClient
    g++ -pthread -o bin/StompBookClubClient bin/ConnectionHandler.o  bin/Book.o bin/keyboardInputSend.o bin/socketReader.o bin/User.o $(LDFLAGS)

StompBookClubClient: bin/StompBookClubClient bin/ConnectionHandler.o  bin/Book.o bin/keyboardInputSend.o bin/socketReader.o bin/User.o

bin/Book.o: src/Stomp/Book.cpp
    g++ -pthread $(CFLAGS) -o bin/Book.o src/Book.cpp

bin/ConnectionHandler.o: src/Stomp/ConnectionHandler.cpp
    g++ -pthread $(CFLAGS) -o bin/ConnectionHandler.o src/ConnectionHandler.cpp

bin/keyboardInputSend.o: src/Stomp/keyboardInputSend.cpp
    g++ -pthread $(CFLAGS) -o bin/keyboardInputSend.o src/keyboardInputSend.cpp

bin/socketReader.o: src/Stomp/socketReader.cpp
    g++ -pthread $(CFLAGS) -o bin/socketReader.o src/socketReader.cpp

bin/StompBookClubClient.o: src/Stomp/StompBookClubClient.cpp
    g++ -pthread $(CFLAGS) -o bin/StompBookClubClient.o src/StompBookClubClient.cpp

bin/User.o: src/Stomp/User.cpp
    g++ -pthread $(CFLAGS) -o bin/User.o src/User.cpp

.PHONY: clean
clean:
    rm -f bin/*
linux makefile
1个回答
0
投票

我已经检查过makefile中是否有选项卡,而不是4个空格。

检查起来有点困难。您在此处粘贴的Makefile在第5行上有4个空格,并完全产生您所看到的错误。如果我用制表符替换它们,则下一个错误发生在第10行,依此类推。

© www.soinside.com 2019 - 2024. All rights reserved.