allenk / WTL-Wizard-VS2017

WTL (Windows Template for Visual Studio 2017)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WTLsdi compile Error

patton88 opened this issue · comments

(1). WTL91_5321_Final has success installed in VS2017 in Windows 2008 R2 SP2. But, WTLsdi compile Error:

1>------ Rebuild All started: Project: WTL03, Configuration: Debug Win32 ------
1>F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
1>Done building project "WTL03.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

(2). The Windows SDK version 8.1 has installed.But, WTLsdi compile Error:

1>------ Rebuild All started: Project: WTLsdi01, Configuration: Debug Win32 ------
1>stdafx.cpp
1>f:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.10.25017\atlmfc\include\atldef.h(69): fatal error C1083: Cannot open include file: 'errno.h': No such file or directory
1>Done building project "WTLsdi01.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I could make SDI without error.
I think you need to install SDK 8.1 (or SDK 8.1 isn't install properly).
Could you move your SDK Version to 10 ? or Try to confirm the SDK 8.1 installed.
Besides, please try to have a normal ATL or Win32 project and test if they work without problems.

Normal ATL or Win32 project have work without problems.

The Windows SDK version 8.1 has installed.

Windows 2008 R2 SP2 has installed in D:\Windows.
VS2017 has installed in F:\Program Files (x86)
The Windows SDK version 8.1 has installed in d:\Program Files (x86).


d:\Program Files (x86)\Windows Kits\10
d:\Program Files (x86)\Windows Kits\8.1
d:\Program Files (x86)\Windows Kits\NETFXSDK\


To search "errno.h" in D: and F: with Everything:
D:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt\errno.h
F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\Linux\include\usr\include\errno.h
F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\Linux\include\usr\include\asm-generic\errno.h
F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\Linux\include\usr\include\linux\errno.h
F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\Linux\include\usr\include\x86_64-linux-gnu\asm\errno.h
F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\Linux\include\usr\include\x86_64-linux-gnu\bits\errno.h

I setup a new computer and install VS 2017 community (my default machine is using professional). It works well. Here is the snapshots:
capture20170324133547961
capture20170324133624065
capture20170324133901561
capture20170324133700611
capture20170324134007236

How add picture in issues?

I setup a new computer and install VS 2017 enterprise all in D. It works error yet.

Windows 2008 R2 SP2 has installed in D:\Windows.
VS2017 has installed in D:\Program Files (x86)
The Windows SDK version 8.1 has installed in d:\Program Files (x86).

Output
1>------ Build started: Project: WTLsdi01, Configuration: Debug Win32 ------
1>stdafx.cpp
1>d:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.10.25017\atlmfc\include\atldef.h(69): fatal error C1083: Cannot open include file: 'errno.h': No such file or directory
1>Done building project "WTLsdi01.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Error List:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'errno.h': No such file or directory WTLsdi01 d:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.10.25017\atlmfc\include\atldef.h 69

But, WTL Dialog project have error at create, it failed.
Navigation failed. Cannot find
d:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\WTL-Wizard-VS2017\AppWiz\Files_15\HTML\1033\null.htm

I search reg of system, can not find "ProductDir" of
astrRegKeyVer[15] = "Microsoft\VisualStudio\15.0\Setup\VC\ProductDir";


I search all of system reg, there is not ProductDir about VS2017. Only some:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\RemoteAccess\Policy]
"Allow LM Authentication"=dword:00000000
"ProductDir"="%SystemRoot%\System32\IAS"


I have already find bug of VS2017's $(WindowsSDK_IncludePath) and $(WindowsSDK_LibraryPath_x86).

VS2017 auto add $(WindowsSDK_IncludePath) is :
D:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
but folder version fact is:
d:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt

VS2017 auto add $(WindowsSDK_LibraryPath_x86) is:
D:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86
but folder version fact is:
D:\Program Files (x86)\Windows Kits\10\lib\10.0.14393.0\ucrt\x86

Add correct include and library path in VS2017 project VC++ Driectories, compile success at last.

This is a bug of VS2017. To fix this error, you may replace two 10.0.10240.0 with 10.0.14393.0 in below file.
%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Common.props

Do you try select proper SDK over SDK select UI ?
default

You need not select SDK version for every project with this way.

This is a bug of VS2017. To fix this error, you may replace two 10.0.10240.0 with 10.0.14393.0 in below file.
%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Common.props

In VS2017, how can I let WTL create project auto with the highest SDK 10.0.14393.0, rather than SDK 8.1?

Thanks in advance!