1 2 3 4 5 6 | #include <windows.h> int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { return(0); } |
1 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall" x64 |
1 | cl win32_handmade.cpp |
1 2 3 4 5 | Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25834 for x64 Copyright (C) Microsoft Corporation. All rights reserved. win32_handmade.cpp win32_handmade.cpp(1): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory |
1 | INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt; |
1 2 3 | #include <windows.h> by #include "windows.h" |
1 | INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include; |
1 | set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt |
1 2 3 4 5 6 7 8 9 10 11 12 13 | cl win32_handmade.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25834 for x64 Copyright (C) Microsoft Corporation. All rights reserved. win32_handmade.cpp Microsoft (R) Incremental Linker Version 14.12.25834.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:win32_handmade.exe win32_handmade.obj LINK : fatal error LNK1104: cannot open file 'uuid.lib' d:\CTest\code> |
mmozeiko
I suspect OP simply doesn't have correct Windows SDK installed. There is no need to reinstall whole Visual Studio. Just run installer and check if you have "Windows 10 SDK (10.0.16299.0) for Desktop C++ [x86 and x64]" installed.
1 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall" x64 8.1 |
1 2 3 4 5 6 7 | ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.5.3 ** Copyright (c) 2017 Microsoft Corporation ********************************************************************** [ERROR:winsdk.bat] Windows SDK 8.1 : 'include' not found The system cannot find the path specified. [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. *** |
mmozeiko
Did you install everything in default locations? I believe VS doesn't like when it is installed in custom location.
Do you maybe have bad anti-virus running in background that blocks something?
Can you check registry for folliwing values in HKEY_LOCAL_MACHINE\Software\Wow6432Node\Micosoft\Microsoft SDKs\Windows:
- does it have v10.0 with InstallationFolder key pointing to "C:\Program Files (x86)\Windows Kits\10" ?
- does it have v8.1 with InstallationFolder key pointing to "C:\Program Files (x86)\Windows Kits\8.1 ?
Do both of these folders contain "include\um" and "lib\VERSION\um\x64" folders?
1 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall" x64 8.1 |
1 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall" x64 |
1 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall" x64 8.1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | ALLUSERSPROFILE= C:\ProgramData APPDATA= C:\Users\Bjarke\AppData\Roaming CommandPromptType= Native CommonProgramFiles= C:\Program Files\Common Files CommonProgramFiles(x86)= C:\Program Files (x86)\Common Files CommonProgramW6432= C:\Program Files\Common Files COMPUTERNAME= DESKTOP-M7R6QQG ComSpec= C:\WINDOWS\system32\cmd.exe DevEnvDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ DEVPATH= C:\ProgramData\Red Gate\.NET Reflector\DevPath ExtensionSdkDir= C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs FPS_BROWSER_APP_PROFILE_STRING= Internet Explorer FPS_BROWSER_USER_PROFILE_STRING= Default Framework40Version= v4.0 FrameworkDir= C:\Windows\Microsoft.NET\Framework64\ FrameworkDir64= C:\Windows\Microsoft.NET\Framework64\ FrameworkVersion= v4.0.30319 FrameworkVersion64= v4.0.30319 FSHARPINSTALLDIR= C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\ GTK_BASEPATH= C:\Program Files (x86)\GtkSharp\2.12\ HOMEDRIVE= C: HOMEPATH= \Users\Bjarke INCLUDE= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ATLMFC\include; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include; LIB= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ATLMFC\lib\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\lib\x64; LIBPATH= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ATLMFC\lib\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\lib\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\lib\x86\store\references; C:\Windows\Microsoft.NET\Framework64\v4.0.30319; LOCALAPPDATA= C:\Users\Bjarke\AppData\Local LOGONSERVER= \\DESKTOP-M7R6QQG NUMBER_OF_PROCESSORS= 8 OneDrive= C:\Users\Bjarke\OneDrive OS= Windows_NT Path= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages; C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools; C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin; C:\Windows\Microsoft.NET\Framework64\v4.0.30319; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\; d:\CTest; PATHEXT= .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS; .JSE; .WSF; .WSH; .MSC Platform= x64 PROCESSOR_ARCHITECTURE= AMD64 PROCESSOR_IDENTIFIER= Intel64 Family 6 Model 60 Stepping 3, GenuineIntel PROCESSOR_LEVEL= 6 PROCESSOR_REVISION= 3c03 ProgramData= C:\ProgramData ProgramFiles= C:\Program Files ProgramFiles(x86)= C:\Program Files (x86) ProgramW6432= C:\Program Files PROMPT= $P$G PSModulePath= C:\Program Files\WindowsPowerShell\Modules; C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC= C:\Users\Public SESSIONNAME= Console SystemDrive= C: SystemRoot= C:\WINDOWS TEMP= C:\Users\Bjarke\AppData\Local\Temp TMP= C:\Users\Bjarke\AppData\Local\Temp USERDOMAIN= DESKTOP-M7R6QQG USERDOMAIN_ROAMINGPROFILE= DESKTOP-M7R6QQG USERNAME= Bjarke USERPROFILE= C:\Users\Bjarke VBOX_MSI_INSTALL_PATH= C:\Program Files\Oracle\VirtualBox\ VCIDEInstallDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\ VCINSTALLDIR= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\ VCToolsInstallDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ VCToolsRedistDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.12.25810\ VCToolsVersion= 14.12.25827 VisualStudioVersion= 15.0 VS140COMNTOOLS= C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ VS150COMNTOOLS= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\ VSCMD_ARG_app_plat= Desktop VSCMD_ARG_HOST_ARCH= x64 VSCMD_ARG_TGT_ARCH= x64 VSCMD_ARG_winsdk= 8.1 VSCMD_VER= 15.5.3 VSINSTALLDIR= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ VSSDK150INSTALL= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VSSDK windir= C:\WINDOWS WindowsLibPath= References\CommonConfiguration\Neutral WindowsSDKLibVersion= winv6.3\ __DOTNET_ADD_64BIT= 1 __DOTNET_PREFERRED_BITNESS= 64 __VSCMD_PREINIT_PATH= d:\CTest; |
1 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall" x64 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | ALLUSERSPROFILE= C:\ProgramData APPDATA= C:\Users\Bjarke\AppData\Roaming CommandPromptType= Native CommonProgramFiles= C:\Program Files\Common Files CommonProgramFiles(x86)= C:\Program Files (x86)\Common Files CommonProgramW6432= C:\Program Files\Common Files COMPUTERNAME= DESKTOP-M7R6QQG ComSpec= C:\WINDOWS\system32\cmd.exe DevEnvDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ DEVPATH= C:\ProgramData\Red Gate\.NET Reflector\DevPath ExtensionSdkDir= C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs FPS_BROWSER_APP_PROFILE_STRING= Internet Explorer FPS_BROWSER_USER_PROFILE_STRING= Default Framework40Version= v4.0 FrameworkDir= C:\Windows\Microsoft.NET\Framework64\ FrameworkDir64= C:\Windows\Microsoft.NET\Framework64\ FrameworkVersion= v4.0.30319 FrameworkVersion64= v4.0.30319 FSHARPINSTALLDIR= C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\ GTK_BASEPATH= C:\Program Files (x86)\GtkSharp\2.12\ HOMEDRIVE= C: HOMEPATH= \Users\Bjarke INCLUDE= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ATLMFC\include; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include; LIB= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ATLMFC\lib\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\lib\x64; LIBPATH= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ATLMFC\lib\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\lib\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\lib\x86\store\references; C:\Windows\Microsoft.NET\Framework64\v4.0.30319; LOCALAPPDATA= C:\Users\Bjarke\AppData\Local LOGONSERVER= \\DESKTOP-M7R6QQG NUMBER_OF_PROCESSORS= 8 OneDrive= C:\Users\Bjarke\OneDrive OS= Windows_NT Path= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages; C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools; C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin; C:\Windows\Microsoft.NET\Framework64\v4.0.30319; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\; d:\CTest; PATHEXT= .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS; .JSE; .WSF; .WSH; .MSC Platform= x64 PROCESSOR_ARCHITECTURE= AMD64 PROCESSOR_IDENTIFIER= Intel64 Family 6 Model 60 Stepping 3, GenuineIntel PROCESSOR_LEVEL= 6 PROCESSOR_REVISION= 3c03 ProgramData= C:\ProgramData ProgramFiles= C:\Program Files ProgramFiles(x86)= C:\Program Files (x86) ProgramW6432= C:\Program Files PROMPT= $P$G PSModulePath= C:\Program Files\WindowsPowerShell\Modules; C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC= C:\Users\Public SESSIONNAME= Console SystemDrive= C: SystemRoot= C:\WINDOWS TEMP= C:\Users\Bjarke\AppData\Local\Temp TMP= C:\Users\Bjarke\AppData\Local\Temp USERDOMAIN= DESKTOP-M7R6QQG USERDOMAIN_ROAMINGPROFILE= DESKTOP-M7R6QQG USERNAME= Bjarke USERPROFILE= C:\Users\Bjarke VBOX_MSI_INSTALL_PATH= C:\Program Files\Oracle\VirtualBox\ VCIDEInstallDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\ VCINSTALLDIR= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\ VCToolsInstallDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\ VCToolsRedistDir= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.12.25810\ VCToolsVersion= 14.12.25827 VisualStudioVersion= 15.0 VS140COMNTOOLS= C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ VS150COMNTOOLS= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\ VSCMD_ARG_app_plat= Desktop VSCMD_ARG_HOST_ARCH= x64 VSCMD_ARG_TGT_ARCH= x64 VSCMD_VER= 15.5.3 VSINSTALLDIR= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ VSSDK150INSTALL= C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VSSDK windir= C:\WINDOWS WindowsLibPath= References\CommonConfiguration\Neutral WindowsSDKLibVersion= winv6.3\ WindowsSDKVersion= \ __DOTNET_ADD_64BIT= 1 __DOTNET_PREFERRED_BITNESS= 64 __VSCMD_PREINIT_PATH= d:\CTest; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | C:\ProgramData APPDATA=C:\Users\Bjarke\AppData\Roaming CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=DESKTOP-M7R6QQG ComSpec=C:\WINDOWS\system32\cmd.exe DEVPATH=C:\ProgramData\Red Gate\.NET Reflector\DevPath FSHARPINSTALLDIR=C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\ GTK_BASEPATH=C:\Program Files (x86)\GtkSharp\2.12\ HOMEDRIVE=C: HOMEPATH=\Users\Bjarke LOCALAPPDATA=C:\Users\Bjarke\AppData\Local LOGONSERVER=\\DESKTOP-M7R6QQG NUMBER_OF_PROCESSORS=8 OneDrive=C:\Users\Bjarke\OneDrive OS=Windows_NT Path=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\Bjarke\AppData\Local\Microsoft\WindowsApps;;C:\Users\Bjarke\AppData\Local\Programs\Fiddler;C:\Program Files\Microsoft VS Code\bin;C:\Users\Bjarke\AppData\Roaming\npm PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=3c03 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PROMPT=$P$G PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\Users\Bjarke\AppData\Local\Temp TMP=C:\Users\Bjarke\AppData\Local\Temp USERDOMAIN=DESKTOP-M7R6QQG USERDOMAIN_ROAMINGPROFILE=DESKTOP-M7R6QQG USERNAME=Bjarke USERPROFILE=C:\Users\Bjarke VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\ VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ windir=C:\WINDOWS |
mmozeiko
How does "d:\CTest" get into PATH? It's not there by default. And I don't think vsvarsall.bat is setting it. I'm guessing that somebody who is putting d:\ctest into PATH is dropping all the other values.
1 2 3 | set PATH=d:\CTest; call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall" x64 cd /d d:\CTest\code |