Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to use GCC (linux) with a makefile to compile my project.

(我正在尝试使用GCC(linux)和makefile来编译我的项目。)

I get the following error which is can't seem to decipher in this context:

(我得到以下错误,在这种情况下似乎无法破译:)

"No rule to make target 'vertex.cpp', needed by 'vertex.o'.  Stop."

This is the makefile:

(这是makefile:)

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
  ask by Meir translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
412 views
Welcome To Ask or Share your Answers For Others

1 Answer

That's usually because you don't have a file called vertex.cpp available to make.

(这通常是因为您没有可用的名为vertex.cpp的文件。)

Check that:

(检查:)

  • that file exists.

    (该文件存在。)

  • you're in the right directory when you make.

    (当你做的时候,你在正确的目录中。)

Other than that, I've not much else to suggest.

(除此之外,我没有其他建议。)

Perhaps you could give us a directory listing of that directory.

(也许你可以给我们一个该目录的目录列表。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...