Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of msvcr120.dll/msvcp120.dll dependency in my Release application (VC++ 2013)

I know that there are some questions about how to include msvcr120.dll/msvcp120.dll into your project.

But I want to drop that dependency. I compile the program in Release version, in Visual Studio 2013. I do not depend on any VS-specific commands (#pragma etc.) or precompiled headers etc.

I want to compile it to one single release .exe and provide it to user WITHOUT demanding him to install VC++ Redistributes for VS (the user will be working on Windows 7, Windows 8, maybe Windows XP).

Is that possible? If so, how?

like image 687
PolGraphic Avatar asked Dec 01 '14 19:12

PolGraphic


People also ask

How do I fix Msvcp120 dll?

Fix 4: Do a Clean Installation of the Affected Program As part of the Microsoft Visual C Runtime Library file, you can just download and try reinstalling the program into your computer. Manual download of MSVCR120. dll files is another way to resolve the . dll missing from your computer error message.

How do you fix the code execution Cannot proceed because Msvcp120 dll was not found?

Reinstalling the program may fix this problem. msvcp120. dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vender for support.

What does MSVCR120 dll mean?

msvcr120. dll is an essential file for the Windows operating system. It is used to extract various resources for third-party applications. It is linked to the C++ programming language.

What is MSVCR120 dll missing?

msvcp120. dll is a part of Microsoft Visual C++ and is often required for running programs developed with Visual C++. Some games or applications may need the file in the game/application installation folder. Copying it from Windows systemfolder to the install-folder of the game/application should fix that problem.


2 Answers

You can statically link the runtime to your project by setting the /MT flag. You can find this option in Visual Studio 2013 under Project > [ProjectName] Properties... > Configuration Properties > C/C++ > Code Generation > Runtime Library. Make sure to only set it for the Release configuration.

like image 194
Chris Vasselli Avatar answered Sep 24 '22 07:09

Chris Vasselli


From the comments. To remove the requirement of possibly needing the redistributable you can build your application with the static runtime (/MT option) instead of either of the dynamic runtime choices.

like image 30
drescherjm Avatar answered Sep 22 '22 07:09

drescherjm