我有这个 cpp 文件,其中包含一堆 C 文件。
主文件
extern "C" {
#include "types.h"
#include "file1.h"
}
...
类型.h
#IFNDEF TYPES_H
#DEFINE TYPES_H
typedef unsigned short int char16;
...
#ENDIF // TYPES_H
文件1.h
#include "file2.h"
...
文件2.h
...
char16* testCode();
...
由于某种原因,编译器给我一个错误,即未声明 char16。知道为什么包含不会从 CPP 文件继承到 C 文件吗?任何帮助表示赞赏。谢谢!