Problem Description:
VC + + Program compile-time prompt error: "HANDLE": an undeclared identifier and many other error prompts, as follows: C2065
error C2065: "HANDLE": Undeclared identifier Error C2146: syntax error: Missing ";" (in front of identifier "Hfind") Error C2065: "Hfind": Undeclared identifier error C2065: "Invalid_handle_value": Undeclared identifier error C2065: "Win32_find_data ": Undeclared identifier Error C2146: syntax error: Missing"; " (in front of identifier "Fdata") Error C2065: "Fdata": Undeclared identifier error C2065: "Hfind": Undeclared identifier error C2065: "Fdata": Undeclared identifier error C3861: "Find Firstfile ": identifier not found error C2065:" Hfind ": Undeclared identifier error C2065:" Invalid_handle_value ": Undeclared identifier error C2065:" Fdata ": Undeclared identifier error C2228: The left side of ". cFileName" Must have class /structure/union
Find a bit of the corresponding header file for winbase.h, naturally added up:
#include <winbase.h>
However, when you add winbase.h, you are prompted Winbase.h (243): Error C2146: syntax error: Missing ";" (in front of the identifier "Internal"), and many more error prompts, as follows:
1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (243): Error C2146: syntax error: Missing ";" (in front of the identifier "Internal")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (243): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (243): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (244): Error C2146: syntax error: Missing ";" (in front of the identifier "Internalhigh")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (244): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (244): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (247): Error C2146: syntax error: Missing ";" (in front of the identifier "Offset")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (247): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (247): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (248): Error C2146: syntax error: Missing ";" (in front of the identifier "Offsethigh")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (248): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (248): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h ( -): Error C2146: syntax error: Missing ";" (in front of the identifier "Pointer")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h ( -): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h ( -): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (253): Error C2146: syntax error: Missing ";" (in front of the identifier "hevent")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (253): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (253): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (257): Error C2146: syntax error: Missing ";" (in front of the identifier "lpCompletionKey")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (257): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (257): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (259): Error C2146: syntax error: Missing ";" (in front of the identifier "Internal")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (259): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (259): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (260): Error C2146: syntax error: Missing ";" (in front of the identifier "dwnumberofbytestransferred")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (260): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (260): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h ( the): Error C2146: syntax error: Missing ";" (in front of the identifier "Nlength")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h ( the): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h ( the): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (265): Error C2146: syntax error: Missing ";" (in front of the identifier "Lpsecuritydescriptor")1>c:\program files (x86) \microsoft Sdks\windows\v7.0a\include\winbase.h (265): Error C4430: Missing type specifier-assumed to beint。 Note: C + + does not support the defaultint
Workaround:
Replace #include <winbase.h> with #include <windows.h> .
VC + + Compiler Error C2065: "HANDLE": undeclared identifier and prompt winbase.h (243) After adding winbase.h: Error C2146: syntax error: Missing ";" Workaround for (in front of identifier "Internal")