makefile,缺少分隔符错误

Sam*_*Sam 7 c++ cygwin makefile g++

我写了一个非常简单makefilec++程序,但它返回makefile:2: *** missing separator. Stop.错误.它出什么问题了?

makefile:

all:
[tab]g++ function.cpp -o out
Run Code Online (Sandbox Code Playgroud)

我在cygwin和中编译程序Ubuntu.

谢谢

bil*_*llz 8

你需要一个真正的选项卡而不是g ++命令前面的空格,你也不需要function.h输入g ++命令.

all:
    g++ function.cpp  -o out
^^^ tab here  
Run Code Online (Sandbox Code Playgroud)


小智 3

不要使用 4(8?)个空格,而是<tab>在第二行的开头使用。