问题描述:

VC++程序编译时提示错误:error C2065: “HANDLE”: 未声明的标识符等众多错误提示,如下所示:

error C2065: “HANDLE”: 未声明的标识符
error C2146: 语法错误: 缺少“;”(在标识符“hFind”的前面)
error C2065: “hFind”: 未声明的标识符
error C2065: “INVALID_HANDLE_VALUE”: 未声明的标识符
error C2065: “WIN32_FIND_DATA”: 未声明的标识符
error C2146: 语法错误: 缺少“;”(在标识符“fdata”的前面)
error C2065: “fdata”: 未声明的标识符
error C2065: “hFind”: 未声明的标识符
error C2065: “fdata”: 未声明的标识符
error C3861: “FindFirstFile”: 找不到标识符
error C2065: “hFind”: 未声明的标识符
error C2065: “INVALID_HANDLE_VALUE”: 未声明的标识符
error C2065: “fdata”: 未声明的标识符
error C2228: “.cFileName”的左边必须有类/结构/联合

查找了一下所对应的头文件为winbase.h,自然就添加上去了:

#include <winbase.h>

但是当添加winbase.h后又提示winbase.h(243): error C2146: 语法错误: 缺少“;”(在标识符“Internal”的前面)等众多错误提示,如下所示:

>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“Internal”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“InternalHigh”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“Offset”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“OffsetHigh”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“Pointer”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“hEvent”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“lpCompletionKey”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“Internal”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“dwNumberOfBytesTransferred”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“nLength”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C2146: 语法错误: 缺少“;”(在标识符“lpSecurityDescriptor”的前面)
>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h(): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int

解决办法:

  将#include <winbase.h>替换成#include<windows.h>就行了。

#include<windows.h> 

VC++编译错误error C2065: “HANDLE”: 未声明的标识符及添加winbase.h后提示winbase.h(243): error C2146: 语法错误: 缺少“;”(在标识符“Internal”的前面)的解决办法的更多相关文章

  1. error C2065:未声明的标识符错误

    原文地址:http://blog.sina.com.cn/s/blog_8216ada701017evx.html 在VS2010下进行VC++调试时,出现这样一种错误:error C2065:未声明 ...

  2. 引用其他头文件时出现这种错误,莫名其妙,error C2065: “ColorMatrix”: 未声明的标识符

    今天做项目时,直接拷贝了另一个工程里的头文件和源文件,然后运行时就出现这种问题,莫名其妙,在原程序里运行一点问题就没有,但是在新工程里就是error. >e:\c++\button_fly2\b ...

  3. error C2065: “SHCNE_DELETE”: 未声明的标识符

    转自VC错误:http://www.vcerror.com/?p=1383 问题描述: 编译时出现: error C2065: "SHCNE_DELETE": 未声明的标识符 er ...

  4. error C2065: “CDatabase”: 未声明的标识符

    使用vc++与access的接口时出现错误“error C2065: “CDatabase”: 未声明的标识符” 解决方法: 添加 #include "afxdb.h"

  5. error C2065: “IDD_DIALOG1” : 未声明的标识符

    编译时提示error C2065: “IDD_DIALOG1” : 未声明的标识符 错误的可能原因及解决方法如下: 1.出错文件中没有包含资源文件ID声明的resource.h文件.在出错文件中加入# ...

  6. MFC error C2065: “IDD_DIALOG1” : 未声明的标识符 转载

    error C2065: “IDD_DIALOG1” : 未声明的标识符 1.编译时提示error C2065: “IDD_DIALOG1” : 未声明的标识符 2.错误的可能原因及解决方法如下: 原 ...

  7. error C2065: “CString”: 未声明的标识符 ;fatal error C1189: #error : afxstr.h can only be used in MFC proje

    转自VC错误:http://www.vcerror.com/?p=1388 问题描述: error C2065: "CString": 未声明的标识符 fatal error C1 ...

  8. error C2065: “SHELLEXECUTEINFO”: 未声明的标识符

    转自VC错误:http://www.vcerror.com/?p=1385 问题描述: error C2065: "SHELLEXECUTEINFO": 未声明的标识符 解决方法: ...

  9. 错误 1 error C2065: “IDC_LISTBOX”: 未声明的标识符

    错误的可能原因及解决方法如下:1.出错文件中没有包含资源文件ID声明的resource.h文件.在出错文件中加入#include “resource.h”语句. 2.工程附件包含目录的路径下没有res ...

随机推荐

  1. Map集合框架的练习

    Map是一个很重要的集合框架,它以键值对的方式存储,下面是一个Map集合的小练习,使用了keySet的取出方法. 取出字符串的每一个字符,记录每一个字母出现的次数.使用Map集合框架. package ...

  2. mongodb ISODate问题(大量数据update优化)

    问题描述: 上周有个需求,把mongodb中birthday (ISO日期格式) 转换成北京时间,并保存成string类型. 最初思路: 遍历查找出的结果,逐个加8小时,然后通过_id逐个去updat ...

  3. js-权威指南-Web套接字

    HTTP是一种无状态的协议,,由客户端请求和服务端响应组成.HTTP实际上是比较特殊的网络协议. 大多数基于因特网的网络连接通常包含长连接和基于TCP套接字的双向消息交换.让不信任的客户端脚本访问底层 ...

  4. 前端js获取checkbox的值

    1. var old = $("#old").val(); if (old != null && old != 'undefined' && old ...

  5. struts2、ajax实现前后端交互

    跳过struts2环境搭建部分,或者可以看我的博客(http://www.cnblogs.com/zhangky/p/8436472.html),里面有写,很详细. 需要导入的jar包(struts官 ...

  6. 禅道项目管理软件 为提交Bug页面设置bug必填字段

    为提交Bug页面设置bug必填字段 by:授客 QQ:1033553122 测试环境: 禅道项目管理软件7.1.stable版本 注:仅适合windows版 步骤1.找到xampp\zentao\mo ...

  7. 你用过这种奇葩的C#注释吗

    博客园一位微软MVP的文章 http://www.cnblogs.com/asxinyu/p/4383402.html#autoid-0-0-0 摘录: 我这里说的奇葩,并不是脱离三种方式,而是其注释 ...

  8. [SSRS / RV] (.rdlc报表)冻结表头,固定行列标题

    转自:https://blog.csdn.net/dietime1943/article/details/72846171?utm_source=blogxgwz9 Reporting Service ...

  9. LeetCode题解之Pascal's Triangle II

    1.题目描述 2.题目分析 题目要求返回杨辉三角的某一行,需要将杨辉三角的某行的全部计算出来. 3.代码实现 vector<int> getRow(int rowIndex) { ) ,) ...

  10. .NET实现自动编译

    前言 因每次发布版本的时候,都需要打开vs项目,然后进行编译.如果刚好手里有文件在修改,就需要先签入之类的.所以想找个可以实现自动编译的工具. 在网上查询了不少资料,终于基本上实现了自动编译的功能.因 ...