【发布时间】:2014-10-24 03:44:46
【问题描述】:
在头文件中,我有以下代码,在尝试链接时,标题中出现错误。
#ifndef BOOLEAN_H
#define BOOLEAN_H
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE !FALSE
#endif
#endif
indicating the error occurs in the line of the last #endif
【问题讨论】:
-
为什么要编译一个头文件?
-
@mafso:编译器会检查很多东西,而不仅仅是生成机器码。这有助于检测错别字、遗漏等。