viraj
viraj

Reputation: 1814

Visual Studio C++ MSVCR100.dll error Runtime

I'm developing an application in Visual Studio 2010. The debug and release executable works fine on my PC, but when I try to run it on another PC< i get the MSVCR100.dll not found error. The problem is described here: http://www.rhyous.com/2010/09/16/avoiding-the-msvcr100-dll-or-msvcr100d-dll/ Searching on the web, reveals that you need to have the Visual C++ redistributable installed.

Is there a way to build the project so that the VC++ redistributable is not required ?

Upvotes: 0

Views: 4114

Answers (2)

ssube
ssube

Reputation: 48337

As noted in the page you linked, you can choose to statically build the libraries into your app, which guarantees they are always included. This is done in the project's properties -> C/C++ -> Code Generation -> Runtime Libraries (select multi-threaded or debug, without DLL).

If you don't want to statically link these, you can include the runtime DLLs with your program; this is useful for sharing a particular version between your modules and only yours, but installing the proper redistributable (and allowing upgrades, for security reasons, etc) is much preferred.

When possible, you should use the DLL from the system, to allow future security patches to apply to your program. The redistributable is a few MB and compatible with a variety of OS versions, so asking users to install it or even including it in your installer is not usually a problem.

To avoid using them entirely is perhaps possible, but slightly less feasible. You would have to avoid any code they provide, and MSVCR is the equivalent of libc; most programs use features from it and it's a standard part of the system.

Upvotes: 2

werewindle
werewindle

Reputation: 3029

Yes, you can links CRT statically (check project settings). But it will cause bigger executable size.

Upvotes: 0

Related Questions