2017-10-07 103 views
-1

就一直在尝试写由5个文件生成文件 - > arrays.h arrays.c pointers.h pointers.c stringtest.cMakefile文件不执行,错误预计符号

当我运行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 
+0

在你的'Makefile'中使用更多的变量 –

+2

你在正确的地方使用标签吗? – Marichyasana

+1

请向我们显示确切的错误消息。 * expect [ed]“=”,“,”“;”*看起来更像是来自C编译器的东西。 –

回答

0

您正在使用TAB进行缩进吗? 目标的命令必须缩进。像:

pointers.o: ... 
---->cc -std=c99 ..