What are Windows Kits and how do they work?

In the old days, when developing a C ++ project in Windows in Visual Studio, your version of Visual Studio would have its own version of the C and C ++ libraries, and your project would reference a specific version of the Windows SDK to access the headers for accessing the Win32 platform . If you had several versions of the Windows SDK, there was a complex system with environment variables that allowed you to choose which version of the Windows SDK Visual Studio would use by default.

It wasn’t great, and to make it work correctly, you need to dig a little, but it really worked.

Just upgraded from VS2012 to VS2015, and it seems to me that no matter what the system has been replaced, it is either completely broken, or I just don’t understand it.

  • Update on a simple console application VS2012 C ++, which includes transitions of conio.h in VS2015, without error messages. What for? conio.h is no longer in the Visual Studio C / C ++ libraries, and now lives in Windows Kit 10, updating the project does not reuse the SDK used (as you would expect).

  • Creating a new Hello World C ++ application in VS2015, the C ++ project includes directories inheriting $ (VC_IncludePath) and $ (WindowsSDK_IncludePath). $ (WindowsSDK_IncludePath) extracts the headers from C: \ Program Files (x86) \ Windows Kits \ 8.1, and $ (VC_IncludePath) extracts the headers from C: \ Program Files (x86) \ Windows Kits \ 10.

Thus, simple project updates fail, which was not reported on the update. Clean new console projects are pulling the headers from two different Windows Kit installations at the same time, and now I have entries for 8.1 and 10 in C: \ Program Files (x86) \ Microsoft SDK and C: \ Program Files (x86) \ Windows Kits. Windows Kit 8.1 contains Win32 and WinRt headers, and Windows Kit 10 contains C / C ++ headers.

Do I have a misconfigured and damaged installation or this mess, how should it be?

If this mess is - how should it be, how should it work? I tried looking for MSDN for information on Windows suites, but I saw nothing but material on the Windows driver suites, which used to be something completely different, but I don't know if that is all.

Is there any documentation that I skipped that explains the rationale for this library configuration and how it is intended to be used?

+7
c ++ windows winapi visual-studio-2015 visual-studio-2012
source share
1 answer

Several times I came across several different variants of this problem: problems that resolve both header files and library dependencies on projects upgraded from VS2012 to VS2015.

Hans comment in response to my question really fixes the problem for headers, but after you come across the same problem for library dependencies, I have something that might be a simpler solution that also works to resolve a failed library.

When you open a VS2012 project in VS2015, automatic updating is not performed. Opening the project properties and changing the General β†’ Platform Toolset for Visual Studio 2015 (v140) will probably reproduce either a variant of the header resolution error described in my original question, or another library dependency resolution error.

The easiest way to find this is to open the project properties and go to the VC ++ directories β†’ Include directories. Among any paths that you could add to your project yourself, you will probably find $ (VCInstallDir) \ include; $ (VCInstallDir \ atlmfc \ include; $ (WindowsSDK_IncludePath)

Click on the path to display the drop-down list and click "Edit", a dialog box will appear on the screen with three sections, from top to bottom, explicitly defined paths, estimated paths and inherited paths. At the very bottom is the "Inherit from parent or default projects" checkbox, which I always considered initially unchecked.

From explicitly defined include paths, remove the $ (VCInstallDir) \ include entries; $ (VCInstallDir \ atlmfc \ include; $ (WindowsSDK_IncludePath) described above and set the option "Inherit from parent or project by default." This should resolve any problems with file header dependencies.

If you also have problems referencing libraries, do the same with the articles in the Library Directory, edit the settings, delete the explicit form entries and select "Inherit from Parent or Default Project". (It might be a good idea to do this even if you don't see any linker errors, otherwise you can use the platform tool compiler option for VS2015 when linking with libraries for VS2012).

I do not know why this grope me when I have not come across anyone else having similar problems. I had no problems updating Visual Studio solutions before.

I also did not find out why some versions of Windows kits now contain Windows platform headers or C ++ library headers, when previously the SDK always contained board headers, while C ++ headers were always part or parcel of Visual Studio. It seems that such a change should have a blog developer somewhere or some other documentation about it. But as long as it works, I don't care.

Hope this helps someone.

+2
source share

All Articles