相关疑难解决方法(0)

处理Winnt.h的奇怪的编译错误

当试图通过windows.h编译包含winnt.h的文件时,我收到以下错误:

MyGl.cpp
..\microsoft sdks\windows\v6.0a\include\winnt.h(964) : error C2988: unrecognizable template declaration/definition
..\microsoft sdks\windows\v6.0a\include\winnt.h(964) : error C2059: syntax error : '&'

他们指向Winnt.h中的以下行

extern "C++" // templates cannot be declared to have 'C' linkage
template <typename T, size_t N>
char (*RtlpNumberOf( UNALIGNED T (&)[N] ))[N];

#define RTL_NUMBER_OF_V2(A) (sizeof(*RtlpNumberOf(A)))
Run Code Online (Sandbox Code Playgroud)

对于发生了什么的任何想法?

我的编译器:

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

c c++ winapi visual-studio

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

c ×1

c++ ×1

visual-studio ×1

winapi ×1