Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 80911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:22:37+00:00 2026-05-10T21:22:37+00:00

When trying to compile a file that include winnt.h via windows.h, I get the

  • 0

When trying to compile a file that include winnt.h via windows.h, I get the following error:

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 : '&' 

They point to the following lines in 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))) 

Any ideas for what’s going on?

My compiler:

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86 Copyright (C) Microsoft Corporation.  All rights reserved.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:22:37+00:00Added an answer on May 10, 2026 at 9:22 pm

    There are at least two ways to do this. The first is to simply include windows.h at the top of all your files. Then include winnt.h only if you need it. However, I find this a bit too much – I don’t see the need of including all this goo in every single file.

    What I do is this at the very top (first thing) in my C/C++ header files.

    #ifndef __wtypes_h__ #include <wtypes.h> #endif  #ifndef __WINDEF_ #include <windef.h> #endif 

    This will get you you the data types, defines, and fundamental Windows API’s. You may also need to add the following:

    #ifndef _WINUSER_ #include <winuser.h> #endif  #ifndef __RPC_H__ #include <rpc.h> #endif 

    WinNT is a bit of a special animal – don’t include it if including the above files works for you. If you do need it, include it after wtypes.h and `windef.h’

    If this doesn’t work, then check your include paths and predefined macros to see if those might be breaking your build.

    Regards, Foredecker

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I always get this error when trying to compile my file with Boost::GIL PNG
I am trying to compile Xuggler under windows. It's ivy.xml file contains the following
I am trying to compile a small .c file that has the following includes:
I am trying to compile something that uses Google's sparsehash include files. libs/include/google/dense_hash_map:93:60: error:
Iam trying to compile a file of the following format by making a parser
I'm trying to compile a .cpp file using g++ in Linux Ubuntu 10.10 and
I'm trying to compile a little project that includes windows.h using the clang compiler.
I'm trying to compile (using cygwin) a C header file that includes netinet/ether.h. On
I'm trying to compile (make) a game source and it seems that my gRace.cpp
I am trying to compile some C++ code that uses threads: #include <iostream> #include

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.