I cannot build my project in Visual Studio 2012. The error is:
1>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V110\\Microsoft.CppBuild.targe
I had this same problem with VS2012. I had both 2013 and 2012 installed on my machine and experienced the issue after uninstalling VS2013 (which I was not using anymore due to expired license).
The Registry keys linked above did not help me. In my opinion, independently from your VS version, the safest way to address this is to locate the batch file VS uses to load those macros, which seems to be VCVarsQueryRegistry.bat in C:\Program Files (x86)\Microsoft Visual Studio [YOUR_VERSION].0\Common7\Tools.
Look for the variable VS tells it is not defined. You might then find a snippet like:
@set WindowsSdkDir=
@call :GetWindowsSdkDirHelper32 HKLM > nul 2>&1
@if errorlevel 1 call :GetWindowsSdkDirHelper32 HKCU > nul 2>&1
@if errorlevel 1 call :GetWindowsSdkDirHelper64 HKLM > nul 2>&1
@if errorlevel 1 call :GetWindowsSdkDirHelper64 HKCU > nul 2>&1
@exit /B 0
:GetWindowsSdkDirHelper32
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0" /v "InstallationFolder"') DO (
@if "%%i"=="InstallationFolder" (
@SET "WindowsSdkDir=%%k"
)
)
@if "%WindowsSdkDir%"=="" exit /B 1
@exit /B 0
:GetWindowsSdkDirHelper64
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0" /v "InstallationFolder"') DO (
@if "%%i"=="InstallationFolder" (
@SET "WindowsSdkDir=%%k"
)
)
Which makes clear that WindowsSdkDir in a 64bit system is set by Registry value SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0\InstallationFolder in either HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE depending on your configuration.
I was getting the error mentioned below when I was trying to install oracle driver for nodejs using npm install oracledb
. I have Windows 7.1 SP1 and I have installed Visual Studio 2015 community edition.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
Installing VC++ compiler as mentioned here resolved the issue for me. For reference here is the action to do.
You need to launch Visual studio, then do: file > new > project, in the window than opened, select "Model > Visual C++" and in the middle of the window you should see a button "install microsoft C++" or something like that, click on it and it will launch the install process for the C++ & Microsoft SDK. Once that's done it will work as expected !
I have been having this issue lately when trying to install certain Node.js packages! I finally fixed it by adding the correct path to the registry variable!
The easiest way to fix it is by setting it with a simple script.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows]
"CurrentInstallFolder"="C:\\Program Files (x86)\\Windows Kits\\8.1\\"
This should fix it for any Windows 8.1 64-bit users, but if you have your Windows SDK installed in another directory, simply replace C:\Program Files (x86)\Windows Kits\8.1
with your respective directory. Here are a few places you can try:
Note: Make sure to append the version as well to the end of the path; for example, 8.1
is at the end of my path. Basically, you need to get the full path to the Windows SDK and not just the folder containing the main folder(s) for the Windows SDK.
I had the same issue with Visual Studio 2013 ( no Service-packs installed ). Apparently during installation it needs an active internet connection or the sdk-path might be missing.
Just go into your control panel / programs / programs & features - and select "Microsoft Visual Studio xxx 2013", right-click-change and then "repair". It will take a few minutes but afterwards the sdk-path is correct.
I was also facing the same issue.
Installing Windows SDK v8.1 solved it for me.
https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx
I was trying to get a script to compile for Script Hook V - GTA .NET Library.
I spent about 2 hours trying to figure out why it wouldn't work. Here is how I got it to build:
I right clicked on the project and selected properties:
Under Configuration Properties -> General -> Platform Toolset
I selected the dropdown and selected the only other one available
(For me it was Visual Studio 2013 - Windows XP (v120_xp))
After that I was able to fly my car normally:
Hope this helps someone else trying to do the same thing.