How to handle msvcr110.dll error

Hi Guys!

Whenever I choose MD (Multi Threaded Dll) I am having msvcr110.dll error with the computers who doesn't have Visual C++ 2005 Redistributable Package. I am not expecting from users to install this.

I read here( http://stackoverflow.com/questions/2035287/static-runtime-library-linking-for-visual-c-express-2008) that changing MD to MT will fix the problem. But this time the complier started to give incompability error with /clr. Then I set No for Common Language Runtime support and it started to give many syntax errors in the code because , i guess, it has no language support for these functions any longer.

Now, the question is, what sould I do exactly or what is the exact settings for the complier to prevent msvcr110.dll error with CLR support without installing Visual C++ 2005 Redistributable Package?

Thanks a lot!
Last edited on
You have a couple ways as:

Distributing the DLL's with the program
Distributing the installer with the program

Personally I recommend you first way in this case.
Just test the program on a pc without the VC Redistributables and look one-by-one which DLL's you need, but you should only need msvcr(version).dll, which in your case version 110 is msvcr100.dll.

Also explaining the name:

MicroSoft Visual C++ Runtime version 11.0

Reason for which it should include all of the standard C and C++ libraries.
Whenever I choose MD (Multi Threaded Dll) I am having msvcr110.dll error with the computers who doesn't have Visual C++ 2005 Redistributable Package.


Switch to "Multi Threaded" (no dll).

Dynamic linking [generally] sucks on Windows.
Last edited on
Switch to "Multi Threaded" (no dll).

I've already tried it.
But this time the complier started to give incompability error with /clr.
Error 1 error D8016: '/clr' and '/MT' command-line options are incompatible

Distributing the DLL's with the program
Distributing the installer with the program

Personally I recommend you first way in this case.

Yes, I don't want an installer for 60KB .exe, too...
So how to
Distributing the DLL's with the program

???
Last edited on
This is the official page for VS2012 redistributable. Please be aware that .NET Framework runtime is also required to be installed in users computer for your application to run.
http://www.microsoft.com/en-us/download/details.aspx?id=30679
I've already tried it.
But this time the complier started to give incompability error with /clr.


Ah... I didn't see this part.

CLR is .NET. I would be very surprised if the msvcr dlls were not included in the .net installation. So any computer that does not have those DLLs would need to install .NET. Just giving the user those specific DLLs will not solve the main problem (and may not even work)

You cannot [reasonably] distribute .NET with your program. It's huge. If your program uses .NET, you'll just have to trust that your users have .NET installed. List it as the program requirements. That's about all you can do.
Flashbond wrote:
So how to
Distributing the DLL's with the program

???

Simply make sure the EXE has 'msvcr110.dll' next to it.

So when you upload your program, you upload it in a ZIP file containing the exe and the so said msvcr110.dll library.

You can either google the library or search it in your PC.

But, here's a link: http://lmgtfy.com/?q=msvcr110.dll


EDIT:

Disch wrote:
CLR is .NET. I would be very surprised if the msvcr dlls were not included in the .net installation. So any computer that does not have those DLLs would need to install .NET. Just giving the user those specific DLLs will not solve the main problem (and may not even work)

You cannot [reasonably] distribute .NET with your program. It's huge. If your program uses .NET, you'll just have to trust that your users have .NET installed. List it as the program requirements. That's about all you can do.


Right, I confirm CLR has something to do with .NET, so you're forced to either redistribute the .NET installer or all the DLL inside the installer.
Last edited on
Right, I confirm CLR has something to do with .NET, so you're forced to either redistribute the .NET installer or all the DLL inside the installer.


My point is that you should do neither of those things.

.NET is a major library that is common enough that if you say ".NET required" your users know that they have to have .NET installed.

You don't see programs distributing DirectX, OpenGL, or Java installers with their programs. And you don't see .NET distributed with programs for the same reason.
OK, I see guys. Briefly the result is, msvcr dlls are too big thus I can't distribute them and .NET has to be installed on the client computer.

But let me talk about my application. It is very simple with only one windows form which has only two textboxes, one label text and a command button. It is containing also one icon file in the resources. And it is only 60KB when you compile it. I don't understand why I need so many dlls for this. http://oi45.tinypic.com/2dvncs8.jpg

Now, I want to ask that what sould I do to keep it this simple without installing all those dlls and other .NET stuff?
Now, I want to ask that what sould I do to keep it this simple without installing all those dlls and other .NET stuff?


It doesn't matter how small your program is. If you're using .NET, then .NET is a dependency and the full thing must be installed on the client computer. There isn't any "mini.NET" that you can distribute with your program.

The only way to avoid the .NET dependency is to not use .NET at all.

So really you have 2 options here:

1) Tell your users to install .NET
or
2) Rewrite your program so that it doesn't use .NET


EDIT:

Generally speaking, if the program is small and has minimal library usage, you might be able to statically link to the library. That way unused portions of the lib (most of it) get omitted. This means no DLLs needed, but also means slightly smaller file sizes.

But it's moot in your case anyway since I don't think .NET can be statically linked because it's so huge.
Last edited on
Flashbond wrote:
And it is only 60KB when you compile it. I don't understand why I need so many dlls for this.

Simple: The DLL's have all the bigger code that will not be stored in your program. Why? Because you will only store a DLL once, where if the code was repeated many and many times in different EXE's, you'd have very less space in your executable. (Reason why in Statically-linked EXE's their size is very big)

Disch wrote:
You don't see programs distributing DirectX, OpenGL, or Java installers with their programs. And you don't see .NET distributed with programs for the same reason.

In fact I never seen only redistributing OpenGL and Java installers.

But, DirectX Installers, .NET Installers and XNA Installers are very common to be packed with installers, or, at least, linked from your website.

Also remembers there are 'WEB Installers' who download the required and updated files by themselves, without requiring a lot of space to be packed with the exe in case you already had the thing you wanted to install.
But, DirectX Installers, .NET Installers and XNA Installers are very common to be packed with installers, or, at least, linked from your website.


True. I don't think he's making an installer, though.

EDIT: But maybe an installer would be the solution he's looking for?
Last edited on
Well, he doesn't really need a complete installer.
He can just use a ZIP file containing his EXE and the Web installers.

Otherwise he can use NSIS, which I used and found to be really nice:

http://nsis.sourceforge.net/Download

It just requires a bit of knowledge of their scripting "engine", which is easy to find. Just look at all the NSIS installers around for free applications.

No one is using .msi's anymore.
Topic archived. No new replies allowed.