0

I'm using VC++ Express, my application needs msvcr100.dll. The user should have this file in his system, is there any way that my application could avoid the use of these files ?

Roman R.
  • 64,446
  • 5
  • 83
  • 139
  • Yup. Statically link the runtime library as opposed to dynamically linking it. That's available in your project settings. (By the way, do avoid tag-spamming. What does this have to do with assembly, api, or C?) – Bathsheba Apr 14 '15 at 10:22
  • How can i do this ? i couldnt find the related settings, thank you for the answer – user2877050 Apr 14 '15 at 10:25
  • Note that you can just place the DLL in the same directory as your executable. It's not the prettiest solution, but it is quite robust. – MSalters Apr 14 '15 at 11:50

2 Answers2

1

In project settings, change Runtime Linrary for Release builds to Multi-threaded /MT (as opposed to Multi-threaded DLL /MD). This switches to static runtime library and eliminates the dependency in question.

enter image description here

See also:

Community
  • 1
  • 1
Roman R.
  • 64,446
  • 5
  • 83
  • 139
0

C and C++ standards don´t only define the languages, but some (many) functions and classes, which a system supporting C/C++ should have (at least). A clean Windows installation has only a subset of the necessary things, while this DLL file has everything (but this DLL is not automatically installed).

Three possibilities:
a) Force every user to install the MSVC redistributable package (according to your question, you don´t want that)

b) Distribute the file yourself together with your program. Problematic because version issues etc., and possibly legal problems in some jurisdictions.

c) Enable "static" linking in the project setting. This will put everything in your own EXE file; it will use more memory but isn´t dependent on the external file anymore. Where to find this in VS: How do I make a fully statically linked .exe with Visual Studio Express 2005?

Community
  • 1
  • 1
deviantfan
  • 10,753
  • 3
  • 26
  • 47