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

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.

Related

Folder "Microsoft Visual Studio 14.0" Is Missing

I'm trying to add pthread library to Visual Studio 2017 (I'm using Windows 10 OS). I'm using the following guide from another post tat I saw, but I can't find the "Microsoft Visual Studio 14.0" folder in "C:\Program Files x86". I have Visual Studio 2017 and It's working. I've checked and I've installed the Visual Studio C++. What else should I install? Is there any other way to include pthread library by just adding it to the project and including the path to the library in the linker or something similar?
Thank you
Since visual studio 2017 visual studio is installed in C:\Program Files (x86)\Microsoft Visual Studio\<version>\<edition> by default e.g. C:\Program Files (x86)\Microsoft Visual Studio\2017\Community. There are other changes to the internal layout of files within the visual studio directory too. Your guide seems to only provide libraries for Visual Studio 2010 and 2012, these won't work in 2017, you should try to find an updated guide (or just use std::thread instead of pthreads).
Installing these files inside the visual studio directory isn't the right approach anyway, install them to a directory of your choice and update your project settings to point to that directory. The lazy approach in the guide is likely to cause problems in the long run.

ATL headers missing when using the VC++ 2015 toolchain on Visual Studio 2017

I am using Visual Studio 2017 for a C++ project (created with VS 2015). I get the following error:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\afx.h(345): fatal error C1083: Cannot open include file: 'atltrace.h': No such file or directory
How can I install the ATL/MFC headers of the VS 2015 toolchain?
Details
"Platform Toolset" setting (at "Project properties/General/Platform Toolset")
set to "Visual Studio 2015 (v140),
changing the platform toolset to "Visual Studio 2017 (v141) compiles fine.
Files on disc
The include directory for VS 2015 (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\) contains afx*.h files but no atl*.h files.
These missing files seem to belong to VC_ATL.Headers.msi ("Visual C++ Library ATL Headers Package") (which I checked on another machine with those files). I could not get the respective msi to install. (I took the msi from the other machine.) Error: "To install this product, please run Setup.exe. [...]".
The respective directory for VS 2017 (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\atlmfc\include\) does contain those files.
Installer
"Windows Desktop Development with C++/VC++ 2015.3 v140 toolset for desktop (x86,x64)" is checked.
It seems to me that the v140 toolset is missing the ATL/MFC headers.
"Windows Desktop Development with C++/MFC and ATL support(x86 and x64)" does not seem relevant, it seems to be about the VS 2017 version.
VC++ redistributable seems irrelevant since those do not contain the header files.
There is a blog post about the Visual C++ Build Tools 2015. The build tools are also released in a standalone version without the need to install Visual Studio 2015:
The Build Tools are the same C++ tools that you get with Visual Studio 2015 but they come in a scriptable standalone installer that only lays down the tools you need to build C++ projects.
Microsoft has included ATL/MFC.
They can be downloaded from http://landinghub.visualstudio.com/visual-cpp-build-tools. Make sure to select "ATL and MFC" which is deselected by default.

Visual Studio c++ download and excecution for new computer with windows 8.1 64bit

I just bought a new computer, with Windows 8.1 64bit installed and wanted to start developing in C++.I am new to Visual Studio, I used to do it with eclipse but suggestions I found in the internet were to prefer Visual Studio.
I tried to download Visual Studio C++ 2008 redistributable package (x64) from here http://www.microsoft.com/en-us/download/details.aspx?id=15336.
But I couldn't find where it was stored in my computer, after searching it with key words. Then I uninstalled it, to install again from scratch.
To uninstall it I opened my control panel and it saw that I have Microsoft Visual C++ 2012 Redistributable (x86) installed already, assuming it comes with the computer I bought, and the date of installation matches this. I can't find though where it is stored so I can't open it.
When downloading Visual Studio 2008, it says I need to uninstall previous Visual Studio versions.
Bottom line:
Should I uninstall the Visual 2012 (x86) that probably came with the computer (which is 64bit)? Or should I use it (and try to find where is it located)?
If I shouldn't use the 2012: Was the 2008 version I tried to install good? (2008 gives an "old" intuition, but just my intuition).
Is there an easy way to find out where the application is located for excecution? Any specific file to look for?
thank you
You want to download thee actual Visual Studio IDE from http://www.visualstudio.com/ . Try downloading the free Community Edition for a start.
The Visual Studio redistributable packages are actually the minimal runtime libraries to run C++ programs that were compiled with visual studio. You got a version installed by default even on fresh computers, otherwise you can't run many programs (they are also included with the IDE).
The redistributables are also often bundled with installers to make sure that others can run your programs.
The VC++ Redistributable packages only include the libraries required to run applications built with the respective version of Visual Studio (for example Microsoft Visual C++ 2012 Redistributable is for Visual Studio 2012).
It does not include any version of Visual Studio.
You could uninstall Microsoft Visual C++ 2012 Redistributable (x86) but however as it was preinstalled on your computer, I imagine that some program pre-installed by the computer manufacturer requires it. It's probably not a good idea to remove that.
So no, it's not a good idea to remove it.
In order to use the 2012 version of Microsoft Visual C++ 2012 Redistributable you should install the vs120 compiler, aka the VC++ compiler that comes with Microsoft Visual Studio 2012.
For developing with Microsoft Visual Studio 2008, using Microsoft Visual C++ 2008 Redistributable is completely fine as it matches the compiler version. However if you want to use the newer 2010, 2012, 2013, and 2015 versions you need to use those respective versions of the Microsoft Visual C++ Redistributable.
If you wish to use an up-to-date version of Visual Studio, try the Visual Studio 2013 Community Edition, or if you're feeling adventurous try the Visual Studio 2015 Release Candidate.
The application you built is always located in the project's directory, under /Debug or /Release, depending on whether you built a debug or release version of the application. If you do not know where your project folder is located you may right-click your project in the File pane and click Open folder in Windows Explorer.

MSVCP120d.dll missing

Every time I want to compile my Visual Studio project I get the message that MSVCP120d.dll is missing. Google can't help me. I already installed some redistributables but they didn't help. I also found this:
Msvcp120d.dll Debug version of C++ runtime. No redistribution
allowed.
http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963(v=vs.85).aspx
From the comments, the problem was caused by using dlls that were built with Visual Studio 2013 in a project compiled with Visual Studio 2012. The reason for this was a third party library named the folders containing the dlls vc11, vc12. One has to be careful with any system that uses the compiler version (less than 4 digits) since this does not match the version of Visual Studio (except for Visual Studio 2010).
vc8 = Visual Studio 2005
vc9 = Visual Studio 2008
vc10 = Visual Studio 2010
vc11 = Visual Studio 2012
vc12 = Visual Studio 2013
vc14 = Visual Studio 2015
vc15 = Visual Studio 2017
vc16 = Visual Studio 2019
The Microsoft C++ runtime dlls use a 2 or 3 digit code also based on the compiler version not the version of Visual Studio.
MSVCP80.DLL is from Visual Studio 2005
MSVCP90.DLL is from Visual Studio 2008
MSVCP100.DLL is from Visual Studio 2010
MSVCP110.DLL is from Visual Studio 2012
MSVCP120.DLL is from Visual Studio 2013
MSVCP140.DLL is from Visual Studio 2015, 2017 and 2019
There is binary compatibility between Visual Studio 2015, 2017 and 2019.
I have found myself wasting time searching for a solution on this, and i suspect doing it again in future. So here's a note to myself and others who might find this useful.
If MSVCP120.DLL is missing, that means you have not installed Visual C++ Redistributable Packages for Visual Studio 2013 (x86 and x64). Install that, restart and you should find this file in c:\Windows\System32 .
Now if MSVCP120D.DLL is missing, this means that the application you are trying to run is built in Debug mode. As OP has mentioned, the debug version of the runtime is NOT distributable.
So what do we do?
Well, there is one option that I know of: Go to your Project's Debug configuration > C/C++ > Code Generation > Runtime Library and select Multi-threaded Debug (/MTd). This will statically link MSVCP120D.dll into your executable.
There is also a quick-fix if you just want to get something up quickly: Copy the MSVCP120D.DLL from sys32 (mine is C:\Windows\System32) folder. You may also need MSVCR120D.DLL.
Addendum to the quick fix: To reduce guesswork, you can use dependency walker. Open your application with dependency walker, and you'll see what dll files are needed.
For example, my recent application was built in Visual Studio 2015 (Windows 10 64-bit machine) and I am targeting it to a 32-bit Windows XP machine. Using dependency walker, my application (see screenshot) needs the following files:
opencv_*.dll <-- my own dll files (might also have dependency)
msvcp140d.dll <-- SysWOW64\msvcp140d.dll
kernel32.dll <-- SysWOW64\kernel32.dll
vcruntime140d.dll <-- SysWOW64\vcruntime140d.dll
ucrtbased.dll <-- SysWOW64\ucrtbased.dll
Aside from the opencv* files that I have built, I would also need to copy the system files from C:\Windows\SysWow64 (System32 for 32-bit).
You're welcome. :-)
I have the same problem with you when I implement OpenCV 2.4.11 on VS 2015.
I tried to solve this problem by three methods one by one but they didn't work:
download MSVCP120.DLL online and add it to windows path and OpenCV bin file path
install Visual C++ Redistributable Packages for Visual Studio 2013 both x86 and x86
adjust Debug mode. Go to configuration > C/C++ > Code Generation > Runtime Library and select Multi-threaded Debug (/MTd)
Finally I solved this problem by reinstalling VS2015 with selecting all the options that can be installed, it takes a lot space but it really works.
I downloaded msvcr120d.dll and msvcp120d.dll for 32-bit version and then, I put them into Debug folder of my project. It worked well. (My computer is 64-bit version)
My problem was with x64 compilations deployed to a remote testing machine. I found the x64 versions of msvp120d.dll and msvcr120d.dll in
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\Debug_NonRedist\x64\Microsoft.VC120.DebugCRT
I had the same problem in Visual Studio Pro 2017: missing MSVCP120.dll file in Release mode and missing MSVCP120d.dll file in Debug mode.
I installed Visual C++ Redistributable Packages for Visual Studio 2013 and Update for Visual C++ 2013 and Visual C++ Redistributable Package as suggested here Microsoft answer this fixed the release mode.
For the debug mode what eventually worked was to copy msvcp120d.dll and msvcr120d.dll from a different computer (with Visual studio 2013) into C:\Windows\System32
Alternate approach : without installation of Redistributable package.
Check out in some github for the relevant dll, some people upload the reference dll for their application dependency.
you can download and use them in your project , I have used and run them successfully.
example : https://github.com/Emotiv/community-sdk/find/master
I was building my application on VS 2019 when this issue came up. You can copy these DLLs from this location into debug directory of your application to get going.

Including correct C++ redist with an application

I build my application in Microsoft Visual Studio 2010, and want to bundle it with vcredist, but I have to do it manually. Is there a way to automatically get vcredist corresponding to the one I used to build my application? I need only x64 support.
For instance Microsoft Visual Studio 2012 is bundled with vcredist already (it is found under Microsoft Visual Studio 11.0\VC\redist\1033). Microsoft Visual Studio 2010 has similar folder, but there are no executables or packages, only the *.dll files which is not a good option to distribute I think.
From this legal reference about what you can distribute I assume that the file you need is vs100_piaredist located in Program Files\Common Files\Merge Modules.
VS2010 also have the similar folder "/Microsoft Visual Studio 10.0/VC/redist"