"LNK1104 Cannot open file 'kernel32.lib' " when Windows SDK version is set to 15063.13 - c++

I'm doing C++ in Visual Studio 2017, and just recently updated Windows 10 from Anniversary Update to Creator's Update.
I found out by accident that when I'm compiling a DLL project, I would get the error message:
LNK1104 - cannot open file 'kernel32.lib'
After twiddling a bit in the Project Properties, I noticed if the Windows SDK version is set from 10.0.14393.0 to 10.0.15063.0, the error message appears. If I set it back to 10.0.14393.0, I can compile just fine.
I would like to know why when the Windows SDK version is set to the Creator's Update build version, it's throwing this error message, yet it doesn't if set back to the Anniversary Update's build version?
Thanks.

https://developercommunity.visualstudio.com/content/problem/41913/link-fatal-error-lnk1104-in-empty-c-project.html
The Windows 10 Creators Update SDK made some significant changes to
what is installed as part of the installation to minimize on-disk
footprint. This is a Known Issue that results from that refactoring
work where the "desktop" components of the Creators Update SDK do not
get installed by default. The previous new project logic always
selected the latest Windows 10 SDK, assuming the desktop portions were
installed as part of that installation scenario. We are working on a
fix for a future update.
The workarounds available are as follows:
Select a version of the Windows 10 SDK that's fully installed on the system (i.e. 10.0.14393.0 or earlier) in the Project Properties
Install the 'Windows 10 SDK (10.0.15063.0) for Desktop' component via the Visual Studio Installer. win10sdk-15063desktop.png
Daniel Griffing,
Visual C++ Libraries

I have the same problem, honestly, looks like a bug in VS 2017. Just switch to 10.0.10586.0.

Related

Qt VS Tools: error reading VS project settings

I develop an application using Visual Studio 2015 + Qt VS Tools extension. For me it's first time I used Qt (version 5.14.1) in my project. Everything was working fine until something wrong happened.
I was asked to make release version of my application, it worked fine on Windows 10 and Windows 7 64-bit systems. Then I set the project configuration back to Debug x64 to continue my work. First strange thing I noticed - when I double-clicked on *.ui form files in my Solution Explorer, Visual Studio crashed and reloaded without any error, Qt Designer doesn't launch.
What I tried:
First I tried to open Qt Designer externally (from bin folder in Qt directory) and open my form - it worked.
I tried another project made in VS 2015 + Qt VS Tools Extension - same problem.
I tried to remove my Qt Version and re-add it. And here it comes: Error screenshot. It also occurs without using system enviroment variable $(QTDIR).
I reinstalled Qt to my PC (installed version 5.14.2 instead of 5.14.1), same error.
I reinstalled Visual Studio 2015, same error.
I tried to reset my Visual Studio settings and parameters to default, no results.
I installed Visual Studio 2019. The problem is still present.
UPD:
I cleared Visual Studio cache according to these instructions. It didn't work for me.
I removed every Visual C++ Redistributables from my PC and installed the latest version from Microsoft site. It also didn't work.
The error occurs even if no project is opened, so the problem is caused either by Visual Studio 2015, by Qt 5.14, or by Qt VS Tools extension.
P.S. Sorry if my english wasn't perfect. Waiting for any ideas on fixing this problem.
For any future readers who have this problem, start your maintenance tool or Qt installer, e.g. C:\Qt\MaintenanceTool.exe, "Add or remove components", and then make sure Qt/<version>/MSVC is installed, as shown in the image below:
.
Then you'll be able to select that Qt version instead of MinGW, since the Visual Studio extension only supports the MSVC compiler and not MinGW.
Encountered the exact same problem and the only solution I have found was reverting to an older version of the Qt Visual Studio Tools extension.
Visual Studio has been painfully persistent about updating the version even once I installed an older one, so make sure to disable automatic extension updates (Extensions → Manage Extensions → Extension Settings → Uncheck Automatically search for updates/Automatically update extensions).
Hope it helps.
To solve your problem, you need to remove the QTDIR and QMAKESPEC environment variables that remain in Windows after installing older versions of Qt.
Well, after some more procedures that didn't help, I just did clean-reinstallation for my Windows 10. Fortunately, that helped :)

How do I install Windows 10 SDK for use with Visual Studio 2017

I can't figure out how to install Windows 10 SDK for Visual Studio 2017.
I downloaded and ran the Windows 10 SDK installer, and it displays Please find winsdksetup.exe in ....\Windows kits\10\WindowsSDK to install Windows Software Development Kit - Windows 10.0.17134.12.
When I run winsdksetup.exe, it takes me through the same loop, where it downloads a bunch of executable installers into this directory and show the same exact message.
When I try to build a DirectX project in VS2017, I get the error:
MSB8036 The Windows SDK version 10.0.16299.0 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".
Do I need to install one of those installers? Which one do I need to run to build and debug DirectX projects for Visual Studio? Specifically to use VS2017 shader debugging functionality.
Thanks,
EDIT:
Under VS2017 - Tools -> Get Tools and Features
I have checked
Game Development with C++
and under Optional I have
C++ Profiling tools
Windows 10 SDK (10.0.17134.0)
I'm downloading 16299.0, this fixed the first error of not having the right SDK.
But now I get the runtime error Failed Creating the Direct3D device when running in Debug. I can still run samples in Release
The error message shows which SDK you need:
The Windows SDK version 10.0.16299.0 was not found
So the SDK for Windows 10 Fall Creators Update 1709 is missing and you downloaded the SDK for April 2018 Update (1803 Build 17134).
Run Visual Studio 2017 installer (C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe), click on modify, and select 16299 SDK under SDK/framework in individual components tab of the installer:
You can download the required Windows SDK versions from Microsoft:
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
Just install the required version and the build should work.

update to UAP (10.0.16299.0)

Currently I am using VS2017 Community.
I have downloaded the Windows IoT template for VS2017 community to do UWP programming.
After created the project, when I try to open the XAML file in designer view, I encountered this Message:
visual studio requires a newer version of windows to display this content.
please update to windows 10 Fall Creator update(10.0.16299.0)
So, I downloaded latest Win10 SDK
But Now I have this message:
visual studio requires a newer version of windows to display this content.
please update to UAP (10.0.16299.0)
What I need to do?
Thanks
You need the VS 2017 (15.4 update) or later to get the Windows 10 Fall Creators Update SDK (16299) integration.
If you have the 15.4 update already, then run the Visual Studio Installer, go to the Individual Component tab, and then check the components for 16299. Hit Modify.
See this blog post.
UPDATE: For C#/C++ projects, you set which Windows 10 SDK is used by editing the Project Properties and setting the Target Platform Version to 10.0.16299.0. You can also use the "Retarget solution" or "Retarget project" option.

How to fix the error "Windows SDK version 8.1" was not found?

I recently updated visual studio 2015 and now, when i try to build any project it always fails and i get the error
Severity Code Description Project File Line Suppression State
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". Proj D:\Program Files (x86)\visual studio
2017\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141\Toolset.targets 34
I retargeted the solution as it said, and the problem persisted, even though the retargetting was completed.I decided to install visual studio 2017 because of this, and, lo and behold, it did the exact same thing.I'm also using windows 7.
What is the problem and how can i fix it?
I faced this problem too. Re-ran the Visual Studio 2017 Installer, go to 'Individual Components' and select Windows 8.1 SDK. Go back to to the project > Right click and Re-target to match the SDK required as shown below:
I installed the 8.1 SDK's version:
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
It used 1GB (a little more) in the installation.
Update October, 9 (2020). There's a https error: the sdksetup link is https://go.microsoft.com/fwlink/p/?LinkId=323507
"Save link as" should help.
Another way (worked for 2015) is open "Install/remove programs" (Apps & features), find Visual Studio, select Modify. In opened window, press Modify, check
Languages -> Visual C++ -> Common tools for Visual C++
Windows and web development -> Tools for universal windows apps -> Tools (1.4.1)
and Windows 10 SDK ([version])
Windows and web development -> Tools for universal windows apps -> Windows 10 SDK ([version])
and install. Then right click on solution -> Re-target and it will compile
I had win10 SDK and I only had to do retarget and then I stopped getting this error. The idea was that the project needs to upgrade its target Windows SDK.
I realize this post is a few years old, but I just wanted to extend this to anyone still struggling through this issue.
The company I work for still uses VS2015 so in turn I still use VS2015. I recently started working on a RPC application using C++ and found the need to download the Win32 Templates. Like many others I was having this "SDK 8.1 was not found" issue. i took the following corrective actions with no luck.
I found the SDK through Micrsoft at the following link
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/ as referenced
above and downloaded it.
I located my VS2015 install in Apps & Features and ran the repair.
I completely uninstalled my VS2015 and reinstalled it.
I attempted to manually point my console app "Executable" and "Include" directories to the C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1 and C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools.
None of the attempts above corrected the issue for me...
I then found this article on social MSDN https://social.msdn.microsoft.com/Forums/office/en-US/5287c51b-46d0-4a79-baad-ddde36af4885/visual-studio-cant-find-windows-81-sdk-when-trying-to-build-vs2015?forum=visualstudiogeneral
Finally what resolved the issue for me was:
Uninstalling and reinstalling VS2015.
Locating my installed "Windows Software Development Kit for Windows 8.1" and running the repair.
Checked my "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1" to verify the "DesignTime" folder was in fact there.
Opened VS created a Win32 Console application and comiled with no errors or issues
I hope this saves anyone else from almost 3 full days of frustration and loss of productivity.
Grep the folder tree's *.vcxproj files. Replace <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> with <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> or whatever SDK version you get when you update one of the projects.
For me in the Project Properties Settings General->Target Platform -> Change Windows 8.1 to Windows 10 solved the issue
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"
If you do visual studio guide, you will resolve the problem.
I encountered this issue while trying to build an npm project. It was failing to install a node-sass package and this was the error it was printing. I solved it by setting my npm proxy correctly so that it could reach the npm repo
PROBLEM: I ONLY get this compile-time "Windows SDK version 8.1 not found" error ( and a few other very-hard-to-resolve-nuisance errors -- cannot list them all ) when I export a project from an old version of MS Visual Studio (VS) to the new MS VS (2017), using the new MS VS export/"One-way Upgrade" feature.
SOLUTION: I have since learned to not use this export/upgrade feature and instead just create the new project from scratch -- using all my old source files, of course. Only my project settings have to be rebuilt, to be clear.
This is a bit of a pain, and a shame the export/upgrade feature won't work properly like it used to, but this is is actually easier and faster in the long run. MUCH better than working through a list of spurious errors that really should not have arisen in the first place.
Hope this helps...

building empty filter driver with vs 2015 and wdk 10 fails

I couldn't imagine, just how hard it can be for me to start building a sample minifilter driver using vs 2015 and wdk 10!
I've had 2013 running on my pc, then received a swapbuffer sample configured for 8.1. I simply installed WDK 8.1 from Microsoft and that's all. it compiled.
But when I tried to build a minifilter driver using wdk10 everything got hard as hell.
everything is done as this guy said in here and I am on a virtual machine running windows 10.
after installation and that and that and repairing this and that ... when I create an empty fsfilter driver project using vs sample project, build fails with this error:
"An SDK corresponding to WDK version '8.1' was not found. Please install the SDK before building."
This error refers to the file windowsDriver.common.targets in tis line:
<Error Text="An SDK corresponding to WDK version '$(TargetPlatformVersion)' was not found. Please install the SDK before building."
Condition="'$(MatchingSdkPresent)' != 'true'" />
can somebody give me a hint on how to solve this issue?!
thanks.
Windows 10 WDK requires matching SDK version to be installed. Looks like the default for the project you created is falling back to 8.1.
In the project properties, look for Configuration Properties -> General -> "Target Platform version" drop down and select the 10.0.10XXX.0 and try to build it.
If you have installed the latest version of WDK(10.0.105860.0) then make sure the corresponding SDK is installed too. You can check this in the VS installer to see if "Tools (1.2) and Windows 10 SDK (10.0.10586)" under "Universal Windows App Development Tools" is selected.
UPDATE
After much mucking about it turns out that the WDK is not enough; you also need to install the latest Windows 10 SDK which does not by default get installed or updated with Visual Studio. I thought it did, (I've got VS2015, Update 3) but clearly it doesn't. I got the latest version from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
, retargeted my project to the latest version (at the time of writing that is 10.0.14393.0), and both the 10 year old sample and the VS wizzard generated projects now work (at least the small sample I've tried.)