【发布时间】:2017-09-11 04:31:30
【问题描述】:
all: program1 program2
program1: StringListDemo.o
gcc -Wall -std=c11 -Iinclude src/StringListDemo.c src/LinkedListAPI.c -o program1
program2: StructListDemo.o
gcc -Wall -std=c11 -Iinclude src/StructListDemo.c src/LinkedListAPI.c -o program2
试图用两个具有主要功能的文件编译文件夹,但一直出错。
make: *** No rule to make target `StringListDemo.o', needed by `program1'. Stop.
【问题讨论】:
-
如果你编译命令需要一个
.c文件,你为什么要依赖.o? -
从您的标题来看,只有将多个程序目标添加到您的 makefile 中时,您才会遇到问题。您确定它适用于 1 个程序吗?
标签: c makefile compiler-errors