问题描述:

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. Netty的基本概念

    异步 等待它的同时你也可以做点别的事情 阻塞I/O 只能同时处理一个连接,要管理多个并发客户端,需要为每个新的客户端Socket创建一个新的Thread 使用Selector的非阻塞I/O class ...

  2. JavaScript弹出窗口方法

    本文实例汇总了常用的JavaScript弹出窗口方法,供大家对比参考,希望能对大家有所帮助.详细方法如下: 1.无提示刷新网页: 大家有没有发现,有些网页,刷新的时候,会弹出一个提示窗口,点“确定”才 ...

  3. 洛谷P4054 [JSOI2009]计数问题(二维树状数组)

    题意 题目链接 Sol 很傻x的题.. c才100, n, m才300,直接开100个二维树状数组就做完了.. #include<bits/stdc++.h> using namespac ...

  4. OSGI企业应用开发(九)整合Spring和Mybatis框架(二)

    上篇文章中,我们完成了在OSGI应用中整合Spring和Mybatis框架的准备工作,本节我们继续Spring和Mybatis框架的整合. 一.解决OSGI整合Spring中的Placeholder问 ...

  5. AutoCompleteTextView 自定义提示样式

    项目中用到AutoCompleteTextView  自动提示功能,如果用自带的ArrayAdapter就一种样式,非常丑,而且每一项提示文字过多的话不会自动换行. 所以自己自定义了一个适配器. 效果 ...

  6. 关于css样式文件和less的文件的比较说明

    1.css文件 css文件主要的用途是对网页中字体.颜色.背景.图像及其他各种元素的控制,使网页能够完全按照设计者的要求来显示.相信大家都对css比较了解了,再次不作过多说明. 2.less文件 Le ...

  7. 在Windows上安装Gradle

    1.开发环境 (1)Java:JDK8(必须是JDK或JRE7以上,使用java -version查看当前电脑java版本) (2)操作系统:Windows 7 2.安装步骤 (1)下载最新的Grad ...

  8. LeetCode题解之Remove Nth Node From End of List

    1.题目描述 2.问题分析 直接计算,操作. 3.代码 ListNode* removeNthFromEnd(ListNode* head, int n) { if (head == NULL) re ...

  9. 如何从 Windows 虚拟机分离数据磁盘

    当不再需要附加到虚拟机的数据磁盘时,可以轻松地分离它. 这会从虚拟机中删除该磁盘,但不会从存储中删除它. Warning 如果用户分离磁盘,它不会自动删除. 如果订阅了高级存储,则将继续承担该磁盘的存 ...

  10. laravel 安装步骤

    1.将laravel安装文件里的 (composer.bat 和 composer.phar)放在你要使用的php版本 里的:如:D:\phpStudy\php\php-7.0.12-nts 2.进入 ...