5

Possible Duplicate:
Make error: missing separator

I am so stressed out by this silly error...

This is the file...

I've spent an hour trying to find out what's wrong with it.... I am a VIM user. Can someone point out why? I use tab!

Thanks.

all: hello

hello:  hello_world.c   
    gcc -Wall -o hello.exe hello_world.c
Community
  • 1
  • 1
User007
  • 1,519
  • 6
  • 22
  • 35
  • Can you inline that Makefile in your question (and mark it up)? – Flexo Jun 20 '12 at 16:17
  • @Flexo I am not sure if that's a good idea. I've copied and pasted many from stackoverflow and they seen to be bad when i do it. I even set `set paste` in vim. But I will do it in just a moment. – User007 Jun 20 '12 at 16:23

3 Answers3

14

The line that has the gcc command should start with a tab, and it seems you are using expanded tabs (spaces instead of tabs). Try using set noexpandtab in vim.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
marcelog
  • 7,062
  • 1
  • 33
  • 46
3

This is what you have:

all: hello

hello:  hello_world.c   
    gcc -Wall -o hello.exe hello_world.c

The whitespace before the gcc command HAS to be a Tab , not one space, not two spaces, not 3 spaces and so on, but one, and exactly one tab

nos
  • 223,662
  • 58
  • 417
  • 506
  • I believe I have one tab, but I think marcelog is right about my vim setting. But thanks for pointing out, nos. GOod reminder. – User007 Jun 20 '12 at 16:25
  • @User007 The file you linked to in your question contains 4 spaces before the gcc command. Make sure your vim settings does not convert tabs to spaces. – nos Jun 20 '12 at 16:26
  • Yes. Because my configuration made me think it was tab :) Thanks for helping!!! – User007 Jun 20 '12 at 16:28
1

No you don't!

I have downloaded your file -- there four space in it, not tab. You can run :set list in vim to see it yourself.

Please remove the spaces and put the tab instead of it (press ctrl-v ctrl-i).

In future you can add

 # vim:noet

to the file. And your default setting will be overridden by set noexpandtab setting of the file.

Igor Chubin
  • 61,765
  • 13
  • 122
  • 144