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")

Source: Internet
Author: User

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")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.