我不明白为什么下面的代码会给出编译错误,就好像找不到 typedef 定义一样。事实上,如果我添加行“typedef TCHAR my_tchar;” (已经在 win32def.h 中)在 app.h 中编译顺利。
win32def.h
#ifndef win32def_h
#define win32def_h
#include <tchar.h>
typedef TCHAR my_tchar;
#endif
app.h
#include "win32def.h"
int my_function(const my_tchar *filename, ....)
compilation error at line of my_function:
error C2143: syntax error : missing ')' before '*'
最佳答案
用什么编译器? 我不确定,但尝试打开“将 wchar_t 视为内置类型”选项。
关于c - 未找到 typedef 定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9596367/