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

解决_TCHAR标识符错误
本文介绍了一种常见的编译错误:标识符“_TCHAR”语法错误,并提供了解决方案。只需在代码中添加#include<tchar.h>即可避免此错误,实现代码的成功编译。

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

int _tmain(int argc, _TCHAR* argv[])
{
 return 0;
}

添加 #include <tchar.h> 即可成功编译

发生错误了已启动生成… 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
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值