刚刚尝试编写一个由 5 个文件组成的 makefile --> arrays.h arrays.c 指针.h 指针.c stringtest.c
但是,当我运行 make 时,我收到错误,期望“=”,“,”“;”等等,然后它又说没有指定目标。有什么想法吗?
stringtest : stringtest.c arrays.o pointers.o
cc -std=c99 -Wall -pedantic -Werror -o stringtest stringtest.c arrays.o pointers.o
arrays.o : arrays.c arrays.h
cc -std=c99 -Wall -pedantic -Werror -c -o arrays.o arrays.c
pointers.o : pointers.c pointers.h
cc -std=c99 -Wall -pedantic -Werror -c -o pointers.o pointers.c
最佳答案
您使用制表符进行缩进吗? 针对目标的命令必须与其缩进。喜欢:
pointers.o: ...
---->cc -std=c99 ..
关于c - Makefile 未执行,错误需要符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46619485/