c++visual-studio-2015universal-crt

VS2015 fixing path issue in VC_IncludePath


I have a Problem when attempting to compile a simple hello world c++ program.

#include <iostream>

int main()
{
    std::cout << "hello world" << std::endl;
    return 0;
}

Among the errors is:
cannot open source file "errno.h"

A quick search using the console (c:\> dir errno.h /s) reveals that the file is in multiple directories:
C:\LegacyApp\VisualStudio2013\VC\crt\src
C:\LegacyApp\VisualStudio2013\VC\include
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt

My Project Default Properies Include the following macro: $(VC_IncludePath);$(WindowsSDK_IncludePath);

This resolves to:
C:\LegacyApp\VisualStudio2015\VC\include
C:\LegacyApp\VisualStudio2015\VC\atlmfc\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
C:\Program Files (x86)\Windows Kits\8.1\Include\um
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
C:\Program Files (x86)\Windows Kits\8.1\Include\winrt

The folder C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt does not exist on my system.

It seems like I want to switch out the Version 10.0.10240.0 to be 10.0.10150.0

How can I edit the defaults for the macro VC_IncludePath?

Is there an even wiser course of action here?


Solution

  • Seems installation of Windows 10 SDK version 10.0.10240.0 is broken on your machine. You can reinstall it or use the other version installed on your computer.

    If Windows 10 SDK version 10.0.10150.0 installed properly you should be able to use it in your VC++ project. To do that change Target Platform Version on General page of you project configuration to 10.0.10150.0. This value should be among the others in dropdown list.

    Otherwise reinstall Windows 10 SDK and use the recently installed version.