c - 未找到 typedef 定义

标签 c typedef

我不明白为什么下面的代码会给出编译错误,就好像找不到 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/

相关文章:

c - 为什么当输入的找零是 2.2 时,输出显示所需的最小硬币数的正确答案,但当我输入 4.2 时却显示错误的输出?

c - 无法在 gtk3 c 程序中连接来自 Glade 的回调函数

c - 理解这个头文件的这一部分

C - 从队列中存储的项目中检索变量

c - 为什么在 c 中对结构使用下划线?

c - 为什么要更改数组大小值来操作十进制字节?

java - 有向概率图 - 减少循环的算法?

c - 理解 POSIX - fork()

python - 如何使用 python 和 clang 获取 typedef 详细信息

c - 在循环中打印字符串数组