Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to leave Visual Studio 2013 dlls dependencies behind?

My application when opened in others computer will give an error missing msvcr"something".dll, I found out that to fix this they need to install the following: http://www.microsoft.com/en-us/download/details.aspx?id=40784

Which is Visual C++ Redistributable Packages for Visual Studio 2013.

I would like to compile the program with the dlls in the executable already, is such thing possible?

If not possible, where can I get all the dlls to put in the compiled project folder?

like image 724
Guilherme Garcia da Rosa Avatar asked Feb 06 '14 11:02

Guilherme Garcia da Rosa


People also ask

How do you check dependencies in Visual Studio code?

In Solution Explorer, select a project. On the Project menu, choose Project Dependencies. The Project Dependencies dialog box opens. On the Dependencies tab, select a project from the Project drop-down menu.

Do DLLs have dependencies?

When you use depends.exe, be aware that a DLL might have a dependency on another DLL or on a specific version of a DLL. You can use depends.exe on either the development computer or on a target computer. On the development computer, depends.exe reports the DLLs that are required to support an application.

What is the latest Visual C++?

Current versions of the Visual C++ Redistributable for Visual Studio 2015-2022 only support Windows Vista, 7, 8.1, 10, and 11. The last version of the Visual C++ Redistributable that works on Windows XP shipped in Visual Studio 2019 version 16.7 (file versions starting with 14.27).


2 Answers

Try to set /MT for Release and /MTd for Debug in Project Settings->C/C++->Code Generation. This will make your program not dependent on Visual Studio libraries. But beware that all the libraries/ projects you will link with should also have the same option there, otherwise you'll get nasty linker errors.

You may also wish to select v120_xp in General->Platform Toolset for your program to be able to run on Windows XP

like image 91
Predelnik Avatar answered Oct 27 '22 07:10

Predelnik


Because a lot of Programms use the functionality of these dll's they are dynamically linked.
So your filesize stays small and in case of fixes within the dll you dont have to recompile your program.

If you dont want this behaviour you can set in the projectsettings the dll's to "static linked" (/MT). That way they will be compiled into your executable

Here is a relevant MSDN-article

like image 36
Mikescher Avatar answered Oct 27 '22 07:10

Mikescher