Is it necessary to install Visual Studio C++ Build Tools if Visual Studio 2017 is already installed? - c++

Visual studio 2017 community is installed on my PC along with Visual Studio Build Tools 2017. I am using Windows 10.
Is it still necessary to install Visual C++ Build Tools? Is there a possibility that there will be some packages that cannot be compiled if Visual C++ Build Tools is not available even though Visual Studio Build Tools 2017 is there?

Related

Where are the Microsoft Visual C++ 2015-2022 Redistributable (x64) packages installed?

I know visual C++ 2015-2022 is installed because:
A. I see it in Apps & Features (Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.31.31103
B. I see it in registry HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64
but %VCINSTALLDIR% is not set on my path, and I cant find the dll's anywhere.
I need to be really specific with my IT dept to get this fixed. I want to add the dll to the system path but I have to find them first!
I managed to find VC_redist.x64.exe in C:\ProgramData\Package Cache\{2aaf1df0-eb13-4099-9992-962bb4e596d1} but I think that is pretty strange... it may be unrelated to the install.
Any help appreciated!
For me they are at
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC
Do note that %VCINSTALLDIR% only works in the Visual Studio Developer Command Prompt. That should be located under the Visual Studio XXXX folder in your start menu or it can be launched directly from inside visual studio. You can then enter
cd %VCINSTALLDIR%
in the terminal to get where the directory is located on your machine.
According to Github/Microsoft Visual C++ Files are in %VCINSTALLDIR%Redist\MSVC\v143 folder.
The easiest way to locate the redistributable files is by using environment variables set in a developer command prompt. In Visual Studio 2022, the redistributable files are in the %VCINSTALLDIR%Redist\MSVC\v143 folder. In the latest version of Visual Studio 2019, you'll find the redistributable files in the %VCINSTALLDIR%Redist\MSVC\v142 folder. In both Visual Studio 2017 and Visual Studio 2019, they're also found in %VCToolsRedistDir%. In Visual Studio 2015, these files can be found in %VCINSTALLDIR%redist<locale>, where is the locale of the redistributable packages.
I know visual C++ 2015-2022 is installed because:
A. I see it in Apps & Features (Microsoft Visual C++ 2015-2022
Redistributable (x64) - 14.31.31103
...
You're confusing Visual Studio (the development environment) with Microsoft Visual C++ Redistributable (a runtime support library). There isn't even such a thing as "visual C++ 2015-2022". Each version of Visual Studio has one specific year, such as Visual Studio 2017 (VS2017). The redistributable works for all Visual Studio versions between VS2015 and VS2022.
%VCINSTALLDIR% is set by the command prompts of all Visual Studio version, but the value will differ between Visual Studio variants. You can install multiple versions of Visual Studio side by side on the same computer.

Visual C++ component "VCBuild.exe"

I installed visual studio 2015 and able to compile and run c++ test application within the IDE.
My npm installer is throwing the error
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
When I install visual studio 2013, I don't get this error. The libraries this npm project uses is based on visual studio 2015.
Is there something extra I need to do after the Visual studio 2015 install that I don't need to do in visual studio 2013?
Microsoft provides an npm package that solves all these native build issues without the need to install visual studio.
"windows-build-tools": "^1.3.2"

Compiling using MSBuild 12.0 from Microsoft Visual Studio 2015

I have a solution that was compiled with MSVC 12.0 Visual Studio 2013 (C++/CLI and C#) but only have Visual Studio 2015 (Community). I want to build the project using MSVC 12.0 as it was intended, as I only need to rebuild 1 part of the solution (of 5) for my purpose and want it to be compatible with the other DLLs. When trying to build it from MSVC 14.0 (Visual Studio 2015) it says:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found.
Of course I installed the MS Build tools for 2013 (MSVC 12.0, v120) from here: https://www.microsoft.com/en-us/download/details.aspx?id=40760 as well as the Microsoft Visual C++ Redistributable 2013 package.
And the right directory for the 12.0 build tools install is C:\Program Files (x86)\MSBuild\12.0\Bin\amd64
It looks like a configuration error on the solution (or in Visual Studio in general) since it is looking for the build tools in the wrong directory. Does anyone know what settings I need to change / add in Visual Studio to get it to compile with MSBuild 12.0 instead of 14.0? I'd prefer not to install Visual Studio 2013 since I don't use it for anything else (just want to have the option to use VS 2013 MSBUILD within VS 2015 as needed).
Okay I have gotten this working although in a roundabout way. Thanks others that have answered and commented. Sign up for a Microsoft Visual Studio Dev Essentials subscription for free. https://azure.microsoft.com/en-us/pricing/member-offers/vs-dev-essentials/ Then you can go through the menus and download Visual Studio Community 2013 by going to this link and finding it https://my.visualstudio.com/downloads. After doing so, you can build MSVC 12.0 from Visual Studio 2015. Sure, not perfect, but it works. I haven't tried uninstalling Visual Studio 2013 to see if it still works (Windows Phone SDK 8.1 is installed with 2013 as was mentioned to get it working in the Enterprise version of 2015) but if you could somehow keep that and remove the 2013 edition I believe it could work without 2013 installed...
If you go to the top of your .vcxproj change it to this
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Then your .sln can still open in Visual Studio 2015
VisualStudioVersion = 14.0.25420.1
The reason is because the compiler version is specified on a project-by-project basis, and will override the solution version.
I'd prefer not to install Visual Studio 2013 since I don't use it for anything else (just want to have the option to use VS 2013 MSBUILD within VS 2015 as needed).
You can install VS2013 toolset version from your VS2015 installer without installing visual studio 2013. From the 2015 installer, select Windows 8.1 and Windows Phone 8.0/8.1 Tools and common Tools for Visual C++ 2015:
After installation completed, you will find the platform Toolset below:
Then you can built your project with platform toolset Visual Studio 2013(v120).
You can refer to more info from the similar question on SO.

Visual Studio 2015 - Compile C++ with older SDK

I have VS 2015 installed on my PC and I want to build a project using the SDK shipped with VS 2010. I installed Microsoft SDK v7.1 but that didn't affect the environment for VS 2015 so that I can choose it as a toolset. Any tips?
This question (Use Visual Studio 2012 and compile with older platform toolset?) almost answers my question but I'm not if the SDK must be installed before VS 2015.

Share project between Visual Studio 2013 and Visual Studio 2012

I am using Visual Studio 2013 community and created C++ project.
I want to share the project with a colleague working with Visual Studio 2012 professional.
Once he took the project he had to change the toolset to v110 and it worked just fine for him.
When he shared it back with me I got the message:
error MSB8020: The build tools for Visual Studio 2012 (Platform Toolset = 'v110') cannot be found.
To build using the v110 build tools, please install Visual Studio 2012 build tools.
Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".
I do not want to upgrade the solution, as that will cause us each time to change the project, but I couldn't find anywhere to download the VS2012 build tools.
Where can I find Visual Studio 2012 build tools?
You can have both Visual Studio 2012 and Visual Studio 2013 installed on the same machine. Once you have both installed you can use the Visual Studio 2012 compiler in Visual Studio 2013.
So I suggest you install Visual Studio 2012. I think Express edition should be enough.
Alternatively, your colleague can install Visual Studio 2013 Community Edition alongside his existing Visual Studio 2012 Professional Edition. I think the features are roughly equivalent the only question is if they are breaking the license terms.