make: *** No targets specified and no makefile found. Stop.
时间: 2023-09-10 11:08:49 浏览: 53
It seems like you are encountering a "No targets specified and no makefile found" error. This error occurs when the `make` command is executed without specifying a target and there is no `Makefile` present in the current directory.
To resolve this issue, you have a few options:
1. Make sure that you are in the correct directory where the `Makefile` is located. You can use the `ls` command to check the files in the current directory and confirm if the `Makefile` exists.
2. If the `Makefile` is present but has a different name, you can use the `-f` flag to specify the name of the makefile. For example, if your makefile is named "my_makefile", you can run `make -f my_makefile`.
3. If you don't have a `Makefile` and still want to use `make`, you need to create a `Makefile` in your current directory. The `Makefile` is a text file that contains instructions for building your project.
Here is a simple example of a `Makefile` that specifies a default target:
```
all:
gcc -o my_program main.c
```
In this example, running `make` will execute the command `gcc -o my_program main.c`, which compiles the `main.c` file and creates an executable called `my_program`.
Once you have resolved any issues related to the makefile, the "No targets specified and no makefile found" error should be resolved.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)