English 中文(简体)
未指定目标,也未找到生成文件
原标题:No targets specified and no makefile found

我有一个包含以下代码的make文件:

all: main.o Etudiant.o
    gcc -lobjc -o program main.o Etudiant.o
main.o:main.m Etudiant.h
    gcc -c main.m
Etudiant.o:Etudiant.m Etudiant.h
    gcc -c Etudiant.m

当我在shell命令中写入以下内容时:

$make

我得到了这个:

make: **** No targets specified and no makefile found. Stop.

我该如何解决这个问题?

最佳回答

嗯。。。生成文件。Whee。

行开头的所有空白。那一定是标签。或者Make会吐出一个非常模糊的错误。请确保这些是选项卡,然后重试。


请参阅键盘左侧标有“选项卡”的按钮。删除空格并点击一次以插入制表符。


尝试使所有。IIRC(自从我不得不处理makefile以来已经有几年了)大多数make都会默认为all,但也许你的不是。

延期并不重要。


Holy Heck! We are all Extra Dense(@bbum mostly so)!

“未找到Makefile”表示。。。好Make甚至没有看到makefile。将Makefile.m重命名为Makefile的建议是正确的。同样,整个制表符与空白的关系当然是相关的。

问题回答

未找到生成文件

如果您只键入不带参数的makemake allmake将在当前目录中查找名为Makefile的文件。如果它不在那里,你就会得到你看到的错误make不会在子目录中查找Makefile,也不会接受名为Makefile.m的文件。

在我的案例中,我的makefile的名称为makefile,将其更改为makefile有效

Re:
$ Make Make: * No targets specified and no makefile found. Stop.

我刚刚遇到了这个错误,发现Makefile扩展名(none)已经被转换为.bat。

只是在这个错误上度过了一些令人沮丧的时刻。我的错误并没有那么微妙:我将生成文件命名为makefile而不是makefile,所以即使使用-f makefile命令(强制生成文件名)仍然导致找不到,因为它是makefile,而不是makefile。





相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签