源码编译C++ make: *** No targets specified and no makefile found. Stop.
时间: 2023-11-09 16:06:31 浏览: 54
当你在源码编译C++时,如果出现了"make: *** No targets specified and no makefile found. Stop."这样的错误提示,通常是因为缺少Makefile文件或者Makefile文件中没有指定目标。Makefile文件是一个文本文件,其中包含了编译源代码所需的指令和规则。在编译C++源代码时,你需要先编写Makefile文件,然后使用make命令来执行编译过程。如果你没有编写Makefile文件或者Makefile文件中没有指定目标,就会出现上述错误提示。
解决这个问题的方法是检查Makefile文件是否存在,并确保其中指定了正确的目标。如果Makefile文件不存在,你需要先编写一个Makefile文件。如果Makefile文件存在但没有指定目标,你需要编辑Makefile文件并添加正确的目标。另外,你还需要确保你的系统中已经安装了make命令和C++编译器。
相关问题
Redis安装:make: *** No targets specified and no makefile found. Stop.
当Redis安装时出现"make: *** No targets specified and no makefile found. Stop."的错误时,可以尝试以下解决方法:
1. 确保已经正确下载并解压了Redis源代码文件。
2. 进入Redis源代码文件所在的目录,通常是通过cd命令进入该目录。
3. 运行make命令进行编译,如果出现报错信息,可以尝试先安装gcc编译器,可以通过执行"apt-get install gcc"命令来安装。
4. 如果仍然无法解决问题,可以尝试将Redis解压文件删除,重新解压,并再次执行make命令。
5. 进入Redis的src目录,执行make命令。
6. 最后一种方式是进入Redis目录(例如/opt/redis),执行make命令。
通过以上步骤,您应该能够成功解决"make: *** No targets specified and no makefile found. Stop."的错误并完成Redis的安装。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
make make: *** No targets specified and no makefile found. Stop.
make是一个常用的自动化编译工具,它可以根据Makefile文件中的规则自动编译程序。当出现"make: *** No targets specified and no makefile found. Stop."的错误提示时,通常是因为当前目录下没有Makefile文件或Makefile文件中没有指定目标。可以通过以下步骤解决该问题:
1. 确认当前目录下是否存在Makefile文件,如果不存在则需要创建一个。
2. 如果存在Makefile文件,可以尝试执行make命令时指定目标,例如:make target。
3. 如果以上两种方法都无法解决问题,可以尝试重新安装make工具或者检查系统环境变量是否正确配置。