Error in make command makefile:18: *** missing separator. Stop

邮差的信 提交于 2019-11-30 16:50:21

Line 18 is gcc -fPIC -g -c -Wall mymemory.cpp. Make is expecting a separator, typically :. It's not detecting this line as a command. You mistyped the intendation: you have spaces where you should have a tab.

Good editors highlight makefile lines that begin with spaces but look like they should begin with a tab instead.

I have seen this error message when a file used spaces instead of tab character(s) at the beginning of a line in the makefile.

This mostly happens if you copy paste the code from internet. Remove all the spaces from the indented lines by using the delete key. And then press the tab key, only once per line.

Save it and try running the file again. It should work now. This worked for me.

I don't know if it's accurate or an artifact of pasting the code online, but the indentation for the last two commands in the file looks like it's smaller than the commands above it. Double-check your spacing carefully.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!