Visual Studio 2013 Community weird errors - visual-studio

I have recently installed Visual Studio Community 2013 with update 4 and when I try to build my project I get these errors(see below):
C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(362,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1> main.cpp
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\sal_supp.h(57): warning C4005: '__useHeader' : macro redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\sal.h(2886) : see previous definition of '__useHeader'
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\specstrings_supp.h(77): warning C4005: '__on_failure' : macro redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\sal.h(2896) : see previous definition of '__on_failure'
How to solve them? I tried many ways but no luck.

Go to control panel and go to uninstall program.
Choose your visual studio community edition update 4. Select change or repair, if it's there. If it opens to the Visual Studio window then select repair there.
Select repair.
Keep your internet connection on while you do this, so your sdk and platform tools can be updated.
If this doesn't work, there are some links to altering the registry:
https://stackoverflow.com/a/24478856/3956566
https://social.msdn.microsoft.com/Forums/vstudio/en-US/48a4500c-2c48-43dd-822b-10e83258d18b/warning-msb8003-could-not-find-windowssdkdir-variable-from-the-registry-targetframeworkversion-or?forum=visualstudiogeneral
How to set SGEN toolpath in Msbuild to target 3.5 framework
https://code.google.com/p/gyp/issues/detail?id=457

Related

Visual Studio Build Command Macros for determining the version of Visual Studio

Is there a Visual Studio build command macros for determining the version of Visual Studio?
I want a post-build event that runs something in C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\<My MSVS version>, for example C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\14.0
We have different developers with different versions of Visual Studio installed, and this build event is currently hard-coded.
I looked here but didn't see anything.
I found the build command macro I was looking for. This did it for me:
$(MSBuildToolsVersion)
It resolves to the major-minor version number that I'm looking for (ie, 14.0).

Why does 'iprtrmib.h' in Window Kits 8.0 reference 'mprapidef.h' in window 'kits 8.1'?

I am using Visual Studio 2012 (Update 5) with MS Window Kits 8.0 and .NET Framework 4.5.51209. Recently, I also installed MS Window Kits 8.1.
Now, I have a file: '\windows kits\8.0\include\shared\iprtrmib.h' that failes to include 'mprapidef.h'.
That include file only exists at: '\Windows Kits\8.1\Include\shared\mprapidef.h', which is not in my include path.
My Visual Studio 'Include Directories' is set to: "$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);".
These are my Visual Studio macros:
VCInstallDir: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\
WindowsSDK_IncludePath: C:\Program Files (x86)\Windows Kits\8.0\Include\um;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\winrt
When searching, I found a slightly similar question: missing header file on a new installation of visual studio 2012
I tried repairing my Visual Studio installation. I do not want to change the 'Include Directories' for each of my projects. What else should I try?
I installed vs2015 and vs2012, then the same problem occurs,however, I find a solution.
open visual studio project settings,click VC++ Directories, find Include Directories,add the following line to it.
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
One may add the corresponding 8.1 paths to the environment variable.
Maybe it's necessary to do the same thing with the lib environment variable (WindowsSDK_LibraryPath_x86).

Missing Clickonce prerequisites in Visual Studio 2013

I have installed Visual Basic PowerPacks 10.0. It appears as a Clickonce Prerequisite in Visual Studio 2010 but in Visual Studio 2013 Professional It has the yellow triangle next to it and an error is generated when I build my project.
Any help appreciated.
I found a work around. I went to the bootstrapper directory located here:
C:\Program Files (x86)\Microsoft SDKs\Windows\
Visual Studio 2013 looks here for the bootstrapper packages: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\
Inside C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\ I found the VBPowerPacks folder and copied it to C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\
Not sure why VBPowerPacks does not automatically install in all Bootstrapper folders. That would have saved me a great deal of time.

Visual Studio C++ and OpenMPI in windows: missing files.h

I've just correctly installed Visual Studio Express C++ and OpenMPI.
I've added the path to PATH variable:
C:\Program Files\OpenMPI_v1.5.5-win32\bin;
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE;
C:\Program Files\Microsoft Visual Studio 10.0\VC\include
and I've written a simple program in MPI on visual c++ express.
The problem is that when I try to compile from prompt dos
mpicxx -o mpi mpi01.cpp
it tells me that there are a lot of missing files.h (no such file od directory) which are all inside
C:\Program Files\Microsoft Visual Studio 10.0\VC\include
But, as I've just said, I've included this in PATH.
Why does it miss them all?
Your "prompt dos" should be the one you get when you launch the Visual Studio "Developper Command prompt". Shortcut located in your Start Menu -> Programs -> Microsoft Visual Studio -> Visual Studio Tools

type_traits errors

When in VS2010 I add
#include <iostream>
to console aplication template I get many errors in type_traits
error C2275: '_Ty' : illegal use of this type as an expression c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 762 1 pcl1 (Visual Studio 2010)
error C3861: '__is_standard_layout': identifier not found c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 762 1 pcl1 (Visual Studio 2010)
error C2955: 'std::_Cat_base' : use of class template requires template argument list c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 763 1 pcl1 (Visual Studio 2010)
error C2275: '_Ty' : illegal use of this type as an expression c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 768 1 pcl1 (Visual Studio 2010)
an many others...
I don't know why why but I think it's somehow connected with the fact that I'm using both VS2012 and VS2010. How to fix it?
From the error message it is clear that your VS2010 project is somehow being directed to look in the VS2012 include directory, c:\program files (x86)\microsoft visual studio 11.0\vc\include. This is never a good idea.
Check your project settings under C/C++ / General / Additional Include Directories. Remove any references to compiler include directories. The correct directories for your compiler will be automatically located by the system.

Resources