Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Makefile:4: *** missing separator [duplicate]

Tags:

makefile

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
like image 453
User007 Avatar asked Jun 20 '12 16:06

User007


3 Answers

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.

like image 95
marcelog Avatar answered Nov 20 '22 03:11

marcelog


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

like image 3
nos Avatar answered Nov 20 '22 03:11

nos


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.

like image 1
Igor Chubin Avatar answered Nov 20 '22 03:11

Igor Chubin