C++ *** 没有规则来制作目标 'class.cpp',`build/....x86/class.o` 需要停止。Ubuntu 中的错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17888259/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 21:30:49  来源:igfitidea点击:

*** No rule to make target 'class.cpp', needed by `build/....x86/class.o` Stop. error in Ubuntu

c++compilationgnu-make

提问by Joel Seah

I got this error trying to build and compile my program. Now I can't open all my .cpp files in my program.

我在尝试构建和编译我的程序时遇到此错误。现在我无法在我的程序中打开我所有的 .cpp 文件。

make[2]: *No rule to make target Checker.cpp', needed by build/Debug/GNU-Linux-x86/Checker.o'. Stop.

make[2]: *没有规则可以使目标Checker.cpp', needed by 构建/调试/GNU-Linux-x86/Checker.o'。停止。

Anyone can help me with this? I have checked all the online sources but I can't seem to find a solution. I desperately need this solved. Appreciate any help given.

任何人都可以帮我解决这个问题吗?我已经检查了所有在线资源,但似乎找不到解决方案。我迫切需要解决这个问题。感谢您提供的任何帮助。

回答by 0decimal0

You get this error when you don't have a file (Checker.cpp) here to make. Its probably for the following reasons :

当您Checker.cpp在此处没有文件 ( )时,您会收到此错误make。大概有以下几个原因:

  • Your current directory is not the directory in which your file resides.
  • The file may have been moved to somewhere else.
  • Or the worse , the file doesn't exist.
  • 您的当前目录不是您的文件所在的目录。
  • 该文件可能已移至其他地方。
  • 或者更糟糕的是,该文件不存在。