. Advertisement .
..3..
. Advertisement .
..4..
As advised, I used some code samples in another forum, but it could not improve the problem. My question is the “make: *** no rule to make target needed by” in programs – How to solve it? The command line is:
a.out: vertex.o edge.o elist.o main.o vlist.o enode.o vnode.o
g++ vertex.o edge.o elist.o main.o vlist.o enode.o vnode.o
main.o: main.cpp main.h
g++ -c main.cpp
vertex.o: vertex.cpp vertex.h
g++ -c vertex.cpp
edge.o: edge.cpp edge.h
g++ -c num.cpp
vlist.o: vlist.cpp vlist.h
g++ -c vlist.cpp
elist.o: elist.cpp elist.h
g++ -c elist.cpp
vnode.o: vnode.cpp vnode.h
g++ -c vnode.cpp
enode.o: enode.cpp enode.h
g++ -c node.cpp
and the result:
"No rule to make target 'vertex.cpp', needed by 'vertex.o'. Stop."
What does the message mean? Can you advise me to fix it? If you have other better answers, leave them in the answer box below.
The cause: You frequently get that message error because you don’t have a file called
vertex.cpp
to build.Solution: To fix the problem “make: *** no rule to make target needed by”, you should check that:
This error is often caused by an spelling error.
This error occurred to me today.
My error was a spelling mistake. It was missing the third N in MAINTENANCE.
Also, make sure to check the spelling of your filenames.