About _ win32_winnt

Source: Internet
Author: User

I plan to understand the fiber content and try to use it.
When convertthreadtofiber is used, there is always an error in compilation. The prompt message is as follows: Error c2065:
'Convertthreadtofit': Undeclared
Identifier, the compiler tells me that "the function is not declared ". So I checked msdn and found the following content:

Requirements:

Windows NT/2000: requires Windows NT 3.51 SP3 or later.
Windows 95/98: requires Windows 98.
Header: declared in WINBASE. h; Include windows. h.
Library: Use kernel32.lib.

But clearly # include
<Windows. h>. As a last resort, go to WINBASE. h via Windows. h to view the source code. See the Conditional compilation language before the declaration.
Sentence: # If (_ win32_winnt> =
0x0400), and the result shows that my program has no sound macro _ win32_winnt. # Include
<Windows. h> Add a statement before the statement:

# DEFINE _ win32_winnt 0x0400

Compiled.

Understand the functions of _ win32_winnt:

You need to define it in the stdafx. h header file. The compiler determines the Windows version based on this macro. If you need to use a later Win32 function, you must define this macro before using it.

Windows XP _ win32_winnt> = 0x0501
Windows 2000 _ win32_winnt> = 0x0500
Windows NT 4.0 _ win32_winnt> = 0x0400
Windows ME _ win32_windows = 0x0490
Windows 98 _ win32_windows> = 0x0410
Internet Explorer 6.0 _ win32_ie> = 0x0600
Internet Explorer 5.01, 5.5 _ win32_ie> = 0x0501
Internet Explorer 5.0, 5.0a, 5.0b _ win32_ie> = 0x0500
Internet Explorer 4.01 _ win32_ie> = 0x0401
Internet Explorer 4.0 _ win32_ie> = 0x0400
Internet Explorer 3.0, 3.01, 3.02 _ win32_ie> = 0x0300

PS: Of course, you can also set it in the C ++ Preprocessor of the program.

------------------------------------------------------------------------

Description in msdn

Using the SDK Headers

This version
The Microsoft & reg; Platform SDK enables you to create
Applications that run on Microsoft Windows & reg; 95,
Microsoft Windows NT & reg; 4.0, Windows & reg; 98,
Windows Millennium Edition (Windows ME), Windows 2000,
Windows XP, and Windows. NET Server 2003 family. You
Can also create 64-bit applications. The header files
Use data types that allow you to build both 32-and
64-bit versions of your application from a single
Source code base. For more information, see getting
Ready for 64-bit windows.



Microsoft & reg; Visual C ++ & reg; includes content from
The edition of the Platform SDK that was current
The time Visual C ++ was released. Therefore, if you
Install the latest Platform SDK, you may end up
Multiple versions of the same header files on your
Computer. To ensure that you are using the latest
Version of the SDK header files, follow the directions ctions
Supported ded in installing the Platform SDK with visual
Studio. Otherwise, you will receive the following error
When compiling code that uses features that were
Introduced after visual c ++ was released: Error c2065:
Undeclared identifier.

Certain functions that
Depend on a particle version of Windows are
Declared using conditional code. This enables you
Use the compiler to detect whether your application
Uses functions that are not supported on its target
Version (s) of windows. to compile an application that
Uses these functions, you must define the appropriate
Macros. Otherwise, you will receive the c2065 Error
Message. The following table indicates the macros you
Must define to target each system.

Minimum system required macros to define
Windows. NET Server 2003 family _ win32_winnt> = 0x0502
Windows XP _ win32_winnt> = 0x0501
Windows 2000 _ win32_winnt> = 0x0500
Windows NT 4.0 _ win32_winnt> = 0x0400
Windows ME _ win32_windows = 0x0490
Windows 98 _ win32_windows> = 0x0410
Internet Explorer 6.0 _ win32_ie> = 0x0600
Internet Explorer 5.01, 5.5 _ win32_ie> = 0x0501
Internet Explorer 5.0, 5.0a, 5.0b _ win32_ie> = 0x0500
Internet Explorer 4.01 _ win32_ie> = 0x0401
Internet Explorer 4.0 _ win32_ie> = 0x0400
Internet Explorer 3.0, 3.01, 3.02 _ win32_ie> = 0x0300


For example, to use the features specifically marked
For Windows 2000 in the header files, you need
Explicitly define _ win32_winnt as 0x0500 or greater. You
Can define the symbols using the # define statement in
Each source file, or by specifying
/D_win32_winnt = 0x0500 compiler option supported by visual
C ++.

Visual c ++ 6.0: To specify
Compiler Options, go to the projects menu and click
Settings, then select the C/C ++ tab.

Visual c ++ 7.0: To specify compiler options, go to the projects menu and click Properties.

The Macros in win32.mak can help you define
Correct macros. The value of _ win32_winnt depends on
The platform you choose to target. For more
Information, see building applications using win32.mak.

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.