I wrote a very simple makefile for a c++ program, but it returns a makefile:2: *** missing separator. Stop. error makefile:2: *** missing separator. Stop. makefile:2: *** missing separator. Stop. . What is wrong with him?
makefile
c++
makefile:2: *** missing separator. Stop.
makefile :
all: [tab]g++ function.cpp -o out
I will compile the program in cygwin and Ubuntu .
cygwin
Ubuntu
thanks
You need a real tab instead of the space before the g ++ command, also you do not need to embed function.h in the g ++ command.
function.h
all: g++ function.cpp -o out ^^^ tab here
Instead of 4 (8?) Spaces, use <tab> at the beginning of the second line.
<tab>
As indicated here , the most common cause of this error is that lines are indented with spaces when make expects tabs.
make
The second line should begin with a bookmark.
The first line is the target, then you define the rules below the goal. Rule lines must begin with a tab.