manifest is picking predifined redist - c++

i am developing a software using Visual C++ 2008 Express Edition. after build in release mode, i have made a setup file with latest redist 2008. the software is running in my PC fine. in my PC this redist are installed :
in my friends PC, the same redist are installed. but the software is crashing on my friends PC.
from the event log it shows:
as you can see, it is demanding 9.0.21022.8 version of redist whether there is previously installed latest version of redist(9.0.30729.17). so, i go for a google. from the internet, i edit my C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtassem.h
but it didn't help. then i check my project manifest. and i saw :
but i don't know how to edit manifest (i am new in VC++). and i also check C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest. i shows:
i have tried to find out 9.0.21022.8 version of redist in the internet. but i have failed. from my VCExpress installer there is a file named vcredistmin_x86.exe :
as you can see the version of the file is 9.0.21022.8. i think this is the redist i need. but i cannot install it. it says "run the setup.exe file"
what can i do?
Edit(if i am asking two different answer from this question, please inform me. i will delete this edited part):
i am now wanting to deploy my project from Microsoft Visual studio 2008. i have uninstalled previous Microsoft Visual C++ 2008 express edition. but when i am trying to install Microsoft Visual studio 2008, it says
Installation Requirements:
A compatible version of Visual Studio 2008 was not detected on the
system. This update is designed for only the Microsoft Visual Studio
2008 (ENU) product family, and is not compatible with any Express
editions.
guys, have you any idea what to do?

From what I see this download is 9.0.21022.8: http://www.microsoft.com/en-us/download/details.aspx?id=29
I don't know about VS Express, in VS full version there are the vcredist_x86/x64/arm.exe available in the install directory (For VS2012: .../Microsoft Visual Studio 11.0\VC\redist\1033)

If it's acceptable for you, the simplest way to forget about this problems you can statically link with Runtime by changing your project properties: C/C++ -> Code Generation -> Runtime Library, select /MT or /MTd. Runtime library will be included into your executable so you won't have to install it on client machine.

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.

How can I set up Visual Studio 2017 to develop drivers?

According to this forum, https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/windows-wdk-on-visual-studio-2017-community/fdbd2b44-e57a-4849-903d-04001205a764
Windows Driver Kit is not currently supported by visual studio 2017.
I tried installing the Windows Driver Kit, but the test driver projects, such as this one, fail to build
https://github.com/Microsoft/Windows-driver-samples/tree/master/serial/VirtualSerial
I get this error when building:
Error MSB8020 The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found. To build using the WindowsUserModeDriver10.0 build tools, please install WindowsUserModeDriver10.0 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 "Retarget solution".
I already tried retargeting the Solution to the two options I have: 10.0.17134.0 and 8.1, but the same error keeps coming up.
What do I need to do to build this sample driver? Do I need to install VS2015? VS2017 community edition? Why isn't this WDK supported by the Visual Studio 2017 professional version?
Thanks,
Visual Studio 2017 definitely supports kernel-mode device driver development; there's no doubt about that because I've been using VS17 for it for many, many months.
Use the latest version of Windows Driver Kit (WDK) which can be downloaded and installed from MSDN: https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
Furthermore, you can always use the Enterprise WDK and then you can simply build using that if you wanted to from command-line. (Also can be found on page linked-to above)
Download the correct WDK installer for your edition of Visual Studio 2017:
WDK for Windows 10, version 1809 for Visual Studio Community 2017
WDK for Windows 10, version 1803 for Visual Studio Professional 2017
WDK for Windows 10, version 1709 for Visual Studio Enterprise 2017
Visit https://learn.microsoft.com/en-us/windows-hardware/drivers/other-wdk-downloads for more information.
Not exactly a solution, but Windows 8.1 WDK works with Visual Studio 2017 Enterprise,
Download it from here, just need to retarget the project to 8.1
https://www.microsoft.com/en-us/download/confirmation.aspx?id=42273
In addition, I needed to get VS2015 C++ Build Tool to fix a missing Microsoft.cpp.props error
http://download.microsoft.com/download/5/F/7/5F7ACAEB-8363-451F-9425-68A90F98B238/visualcppbuildtools_full.exe
Developing drivers to windows is quite interesting one will be exposed to advanced Operating System Concepts.The set up for the environment will be IDE
IDE - Visual Studio (https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16)
Compilers (WDK)
Debugger (WDK)
WDK contains both(https://go.microsoft.com/fwlink/?linkid=2085767). Latest Visual Studio(VS2019) will come along with the latest WDK(10, 1903 as of now).
Sometimes plugins might not work properly i.e integration issues between Visual Studio and WDk.
By going to the location "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019" and run VSIX installer.
Now in a new project, driver related templates are available.

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.

Visual Studio 2013: CL.exe exited with code -1073741515

I have a fresh Windows 8.1 Pro x64 install with a fresh Visual Studio 2013 Pro.
When trying to compile a project with Platform Toolset to Windows7.1SDK I'm getting
Error 1 error MSB6006: "CL.exe" exited with code -1073741515. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets 57 5 MenuBrowser
I tried running the supplied "Windows SDK Configuration Tool" and besides getting an error about Visual Studio 2005 and 2008 not being installed I think it did its job.
I tried manually editing the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows
where I manually put CurrentInstallFolder as C:\Program Files\Microsoft SDKs\Windows\v7.1\ and CurrentVersion as 7.1.7600.0.30514. If I look at the project properties and click the different paths / variables in there -> more -> Macros, I can see that $(WindowsSdkDir) is correct.
Any idea as to what I should try? Never ran into this problem on the old development computer with Windows 7 and VS 2012.
L.E. as a note, if I try a new project with the v120 tools, it works, but I need the Windows7.1SDK tools.
When trying to compile a project with Platform Toolset to Windows7.1SDK...
That's not a valid selection in a "fresh" install for VS2013. Not very clear what you've been doing, it certainly isn't "fresh" anymore. Do treat Regedit.exe as a loaded weapon, the registry key set that configures VS has been getting pretty doggone convoluted as of late.
The compiler crashes with -1073741515 == 0xC0000135 == STATUS_DLL_NOT_FOUND. That's a pretty serious mishap of course, it should never occur when you target SDK 7.1 since that still uses the same compiler, only the SDK directory is changed. The compiler itself, as well as the DLLs it uses, are not part of the SDK and only are provided if the machine doesn't have VS installed. You can use SysInternals' Process Monitor to diagnose this, you'll see the CL.EXE process searching for a DLL and not finding it.
The correct way to target 7.1 is to use the v120_xp toolset selection. That builds programs that can still run on XP, it automatically also selects the 7.1A SDK that was installed on your machine. Do try to undo the changes you've made.
Referencing Yodans solution from
How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?:
As pointed out by Hans Passant cl.exe looks for mspdb100.dll (among others) and does not find them.
The needed files are in the directory mentioned in 7. below:
My working setup:
VS2013 needs to use VS2010 libs
Using WinSDK 7.1 build tools (v100) in VS2013
clean install, uninstalling everything mentioned in the sdk release notes (can be downloaded at http://www.microsoft.com/en-us/download/details.aspx?id=8279 under category Details)
Microsoft Windows SDK for Windows 7 (7.1) (the Windows SDK core-component files)
Application Verifier
Debugging Tools for Windows
Windows Performance Toolkit
Microsoft Help Viewer 1.0
Microsoft Visual C++ 2010 Redistributable
Microsoft Visual C++ 2010 Standard Edition
Additionally removed all .NET and VC++ related MS Software (not tested if necessary)
choosing Windows7.1SDK as Platform Toolset in VS2013
error MSB6006: "CL.exe" exited with code -1073741515
cl.exe looks for one of msobj100.dll, mspdb100.dll, mspdbcore.dll and mspdbsrv.exe
Added to PATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Build works and binary is usable!
A mistake I did:
copied files in 6. above to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin, believing this directory is in PATH, but it was not!
So better do as sugested in 7. above or by Yodan in How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?
The following steps work for me in VS 2017.
1.Close VS 2017.
2.Restart machine.
3.Open solution in VS 2017.
4.Build the project.
This time I didn't get following error and it builds successfully.
error msb6006 "link.exe" exited with code -1073741819.

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.