我正在 Eclipse 中编写 C 项目,在尝试运行它时收到以下错误消息:
(Cannot run program "make": Launching failed)
我的 Makefile 是:
all : GenericHashTable.o TableErrorHandle.o
gcc -Wall GenericHashTable.o TableErrorHandle.o -o all
GenericHashTable.o : GenericHashTable.c GenericHashTable.h TableErrorHandle.h
gcc -Wall -c GenericHashTable.c -o GenericHashTable.o
TableErrorHandle.o : TableErrorHandle.c TableErrorHandle.h
gcc -Wall -c TableErrorHandle.c -o TableErrorHandle.o
clean :
rm all *.
最佳答案
您的 makefile 或您的问题中的格式是否损坏?目标和依赖项下方行中的命令。这个 makefile 可以从命令行运行吗?
假设 makefile 是正确的,请检查明显的事情,例如确保 Eclipse 可以看到您的工具链。也许它甚至找不到 make 命令,或者您还没有从首选项中设置它。
此外,CDT 还提供了一个托管 makefile 和一个标准(手动)makefile。托管意味着 Eclipse 将为您创建 makefile。标准 makefile 是您负责编写的 makefile。也许如果您的项目很简单,您应该使用托管 makefile 来避免编写一个的麻烦。
关于c - Eclipse 无法运行我的 Makefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3582310/