Thanish K
Thanish K

Reputation: 37

Makefile not working: Command not found and Error 127

I'm building MAKEFILE on my project and I'm not sure what is wrong it. These are the errors I got after running make all:

client server make:
client: Command not found
make: *** [Makefile:4: all] Error 127

Here's my Makefile code:

LINK=g++

all: 
    client server

client: client.cpp
    $(LINK) client.cpp -o client

server: server.cpp
    $(LINK) server.cpp -o server

clean:
    rm -rf client server
``

Upvotes: 0

Views: 3592

Answers (1)

Sam Varshavchik
Sam Varshavchik

Reputation: 118292

all: 
    client server

This specifies that in order to build all, make needs to execute the following command:

client server

Since there is no such command called "client" in your path, this is the result that you see: a "command not found" error message.

You obviously meant to specify a dependency, instead of a command:

all: client server

Upvotes: 1

Related Questions