我正在为我的程序构建一个make文件。 主要是:twitServer.cpp 及其使用:Command.h Client.h编译和链接C++程序 - make文件
我建立了一个make文件,它似乎不工作。 你能帮我弄清楚吗?
twitServer: twitServer.o Command.o Client.o
g++ -Wall -o twitServer.o Command.o Client.o twitServer
twitServer.o: twitServer.cpp Command.h Client.h
g++ -c -Wall twitServer.cpp
Command.o: Command.cpp Command.h
g++ -c -Wall Command.cpp
Client.o: Client.cpp Client.h
g++ -c -Wall Client.cpp
clean:
rm twitServer Client.o Command.o Client.o
我的错误是: G ++:twitServer:没有这样的文件或目录
虽然我得到了这一切的文件: Client.cpp Client.o Command.h的Makefile twitServer.cpp Client.h Command.cpp Command.o的Makefile〜twitServer.o
请详细说明'似乎没有工作'。你有错误吗? –
您确定您在命令开头处有TAB特殊字符吗? (在g ++之前)。当您尝试运行该生成文件时,收到的错误消息是什么? – ondrejdee
这是错误:g ++:twitServer:没有这样的文件或目录 –