【发布时间】:2015-06-19 02:43:39
【问题描述】:
这是我的结构:
- 生成文件
- src/main.cpp
- 包括/xml.hpp
我的 Makefile 如下所示:
# Define compiler: gcc for C program, define as g++ for C++
CC = g++
# Compiler flags:
# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
CFLAGS = -g -Wall
# Build target executable:
TARGET = main
all: $(TARGET)
$(TARGET): $(TARGET).c
$(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c
clean:
$(RM) $(TARGET)
我得到的错误是这样的:
15 *** missing separator. Stop.
我从教程中复制了这段代码,所以我不确定我哪里出错了。
【问题讨论】:
-
$(CC)和$(RM)之前的空格是单个制表符吗?还是 2 个空格? -
一般建议:在文本编辑器中启用“显示空白”选项总是个好主意
-
在问这个问题之前你有没有试过搜索“makefile missing separator”?