error C2061: 语法错误: 标识符“_TCHAR”

本文介绍了遇到标识符“_TCHAR”的错误时的解决办法,即通过包含“tchar.h”头文件来解决。文章详细解释了_tchar类型的定义及其在国际化程序中的应用。

error C2061: 语法错误: 标识符“_TCHAR”解决办法:
标识符“_TCHAR”被定义在“tchar.h”头文件中,包含该头文件即可。

#include <tchar.h> 

在该头文件中定义如下:

#ifndef __TCHAR_DEFINED
typedef wchar_t     _TCHAR;
typedef wchar_t     _TSCHAR;
typedef wchar_t     _TUCHAR;
typedef wchar_t     _TXCHAR;
typedef wint_t      _TINT;
#define __TCHAR_DEFINED
#endif

#ifndef _TCHAR_DEFINED
#if     !__STDC__
typedef wchar_t     TCHAR;
#endif

可以看到声明类型wchar_t为 _TCHAR,wchar_t是C/C++的字符类型,是一种扩展的存储方式,wchar_t类型主要用在国际化程序的实现中,但它不等同于uni编码。uni编码的字符一般以wchar_t类型存储。

错误 12 error C1903: 无法从以前的错误中恢复;正在停止编译 D:\CTL1.0\CTL1.0\快手.cpp 294 1 CTL1.0 错误 2 error C2064: 项不会计算为接受 1 个参数的函数 D:\CTL1.0\CTL1.0\快手.cpp 287 1 CTL1.0 错误 6 error C2064: 项不会计算为接受 1 个参数的函数 D:\CTL1.0\CTL1.0\快手.cpp 289 1 CTL1.0 错误 4 error C2065: “varBounds”: 未声明的标识符 D:\CTL1.0\CTL1.0\快手.cpp 288 1 CTL1.0 错误 8 error C2065: “varBounds”: 未声明的标识符 D:\CTL1.0\CTL1.0\快手.cpp 289 1 CTL1.0 错误 10 error C2065: “varBounds”: 未声明的标识符 D:\CTL1.0\CTL1.0\快手.cpp 290 1 CTL1.0 错误 7 error C2143: 语法错误 : 缺少“)”(在“if”的前面) D:\CTL1.0\CTL1.0\快手.cpp 289 1 CTL1.0 错误 5 error C2143: 语法错误 : 缺少“}”(在“if”的前面) D:\CTL1.0\CTL1.0\快手.cpp 289 1 CTL1.0 错误 3 error C2144: 语法错误:“ATL::CComVariant”的前面应有“)” D:\CTL1.0\CTL1.0\快手.cpp 287 1 CTL1.0 错误 1 error C2144: 语法错误:“ATL::CComVariant”的前面应有“}” D:\CTL1.0\CTL1.0\快手.cpp 287 1 CTL1.0 错误 11 error C2228: “.bstrVal”的左边必须有类/结构/联合 D:\CTL1.0\CTL1.0\快手.cpp 290 1 CTL1.0 错误 9 error C2228: “.vt”的左边必须有类/结构/联合 D:\CTL1.0\CTL1.0\快手.cpp 289 1 CTL1.0 19 IntelliSense: 此声明没有存储类或类型说明符 d:\CTL1.0\CTL1.0\快手.cpp 322 2 CTL1.0 21 IntelliSense: 缺少显式类型(假定“int”) d:\CTL1.0\CTL1.0\快手.cpp 323 2 CTL1.0 13 IntelliSense: 应输入“)” d:\CTL1.0\CTL1.0\快手.cpp 286 79 CTL1.0 20 IntelliSense: 应输入“;” d:\CTL1.0\CTL1.0\快手.cpp 322 9 CTL1.0 15 IntelliSense: 应输入声明 d:\CTL1.0\CTL1.0\快手.cpp 312 5 CTL1.0 16 IntelliSense: 应输入声明 d:\CTL1.0\CTL1.0\快手.cpp 314 4 CTL1.0 17 IntelliSense: 应输入声明 d:\CTL1.0\CTL1.0\快手.cpp 316 3 CTL1.0 18 IntelliSense: 应输入声明 d:\CTL1.0\CTL1.0\快手.cpp 318 2 CTL1.0 22 IntelliSense: 应输入声明 d:\CTL1.0\CTL1.0\快手.cpp 324 2 CTL1.0 23 IntelliSense: 应输入声明 d:\CTL1.0\CTL1.0\快手.cpp 325 1 CTL1.0 14 IntelliSense: 应输入一个语句 d:\CTL1.0\CTL1.0\快手.cpp 310 7 CTL1.0
最新发布
12-22
发生错误了已启动生成… 1>------ 已启动生成: 项目: ImageSystem, 配置: Debug Win32 ------ 1>ImageSystemDlg.cpp 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(132,26): error C2065: “gt”: 未声明的标识符 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(132,28): error C2429: 语言功能 "if/switch 中的 init-statement" 需要编译器标志 "/std:c++17" 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(141,23): error C2065: “gt”: 未声明的标识符 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(141,57): error C2660: “SetStretchBltMode”: 函数不接受 1 个参数 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\wingdi.h(4584,25): message : 参见“SetStretchBltMode”的声明 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(142,26): error C2065: “gt”: 未声明的标识符 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(142,28): error C2143: 语法错误: 缺少“)”(在“;”的前面) 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(142,28): error C2661: “ATL::CImage::StretchBlt”: 没有重载函数接受 1 个参数 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(142,30): error C2065: “m_hDC”: 未声明的标识符 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(142,54): error C2059: 语法错误:“)” 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(143,9): error C2065: “gt”: 未声明的标识符 1>C:\Users\John\source\repos\ImageSystem\ImageSystem\ImageSystemDlg.cpp(143,38): error C2660: “SetStretchBltMode”: 函数不接受 1 个参数 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\wingdi.h(4584,25): message : 参见“SetStretchBltMode”的声明 1>已完成生成项目“ImageSystem.vcxproj”的操作 - 失败。 ========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
09-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值