2017-10-07 109 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 ..