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 7984019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:08:10+00:00 2026-06-04T11:08:10+00:00

I am trying to compile a program in Visual Studio 2010 in Windows 7.

  • 0

I am trying to compile a program in Visual Studio 2010 in Windows 7. I am getting a compilation error C2061: syntax error: identifier ‘KNOWN_FOLDER_FLAG’ in Windows header shlobj.h at the marked line:

#if (NTDDI_VERSION >= NTDDI_VISTA)

typedef enum
{
    KF_FLAG_DEFAULT         = 0x00000000,
    KF_FLAG_CREATE          = 0x00008000,
    KF_FLAG_DONT_VERIFY     = 0x00004000,
    KF_FLAG_DONT_UNEXPAND   = 0x00002000,
    KF_FLAG_NO_ALIAS        = 0x00001000,
    KF_FLAG_INIT            = 0x00000800,
    KF_FLAG_DEFAULT_PATH    = 0x00000400,
    KF_FLAG_NOT_PARENT_RELATIVE = 0x00000200,
    KF_FLAG_SIMPLE_IDLIST   = 0x00000100,
    KF_FLAG_ALIAS_ONLY      = 0x80000000,
} KNOWN_FOLDER_FLAG;


DEFINE_ENUM_FLAG_OPERATORS(KNOWN_FOLDER_FLAG);

STDAPI SHGetKnownFolderIDList(__in REFKNOWNFOLDERID rfid,
                              __in DWORD /* KNOWN_FOLDER_FLAG */ dwFlags,
                              __in_opt HANDLE hToken,
                              __deref_out PIDLIST_ABSOLUTE *ppidl);

STDAPI SHSetKnownFolderPath(__in REFKNOWNFOLDERID rfid,
                            __in DWORD /* KNOWN_FOLDER_FLAG */ dwFlags,
                            __in_opt HANDLE hToken,
                            __in PCWSTR pszPath);

STDAPI SHGetKnownFolderPath(__in REFKNOWNFOLDERID rfid,
                            __in DWORD /* KNOWN_FOLDER_FLAG */ dwFlags,
                            __in_opt HANDLE hToken,
                            __deref_out PWSTR *ppszPath);

#endif  // NTDDI_VISTA

#if (NTDDI_VERSION >= NTDDI_WIN7)

STDAPI SHGetKnownFolderItem(__in REFKNOWNFOLDERID rfid,
                            __in KNOWN_FOLDER_FLAG flags, <<<ERROR AT THIS LINE
                            __in_opt HANDLE hToken,
                            __in REFIID riid,
                            __deref_out void **ppv);
#endif // NTDDI_WIN7

In my program the version macros is defined as folows

#define NTDDI_VERSION NTDDI_WINXP

What can be the reason for it not to compile?

It seems to me that the part I am getting the error in must not be compiled at all, but it somehow does.

  • 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. Editorial Team
    Editorial Team
    2026-06-04T11:08:11+00:00Added an answer on June 4, 2026 at 11:08 am

    There is only one logical conclusion: for some reason the expansion of NTDDI_VERSION when this header is compiled is not what you think it is.

    Try troubleshooting by searching for #undef NTDDI_VERSION and making a clean build of your project (might be relevant if you are using precompiled headers).

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

Sidebar

Related Questions

I'm trying to compile my program on Windows via Cygwin with the compilation command:
I am trying to compile this Hello World program in Windows 7 with Visual
I'm using 64 bit Windows 7 Pro and Visual Studio 2010 Pro. I'm trying
I am trying to compile a program that is created from Visual Studio 8,
I'm trying to compile an SFML program I've writting in Visual C++ 2010. It
when I'm trying to compile my c program it gives me this error warning:
I'm just getting started with Visual Studio (2010 Beta) and have some basic questions
I'm trying to build Qt with visual studio (2010), but the build has so
I Have the Visual Studio C++ 2008 Express Edition. I am trying to compile
Recently I am trying to compile the source code of FFTW in Visual studio

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.