I try to transfer the compiled application to another computer, it requires the msvcr100.dll library, why? After all, I use WINAPI. How to make your project without this library?

    4 answers 4

    Well, you can attach this library to the program statically and it will not be required.

    It is done this way: in the properties of the project, go to the point C / C ++, and then to Code Generation. There is a property Runtime Library. Choose one where there is no DLL inscription. Debug (Debug) or not version - it depends on the configuration of the project. example

    It is possible to use a completely different standard library, but it is more difficult and less convenient =)

    • And why is this library needed at all? WINAPI is not enough !? Wash it in VC ++ 6.0 There was no such happiness !? :) Enrages, the fact that any canoe is added to your specific code! I would understand if it was VB ... - rejie
    • It was, it was just part of the OS right away =) The CRT sits there and even everything you need ... Standard C functions - work with strings, files, memory, and everything else is good. There are a lot of things - never listed. In MSDN, there is more detail that stuffed there =) - Alexey Sonkin
    • And what is the difference keys / MT and / MTd? - rejie
    • The fact that the Debug-version has debug information, checks, any additional and all that is necessary at the stage of the program development. - Alexey Sonkin

    First, you can copy the library to the same place where the executable file is located. Secondly, compile the project not in the debug version (Debug), but in the final version (Release), it does not require libraries, since The library code is included in other project files (although I don’t remember their extensions).

      And finally, you can opt out of the standard library option, a screenshot of which resulted above. There is a “no library” option.

      If after that there will be linking errors - do not judge, then you still use it!

      • After that, there will most likely be errors, since in the debug mode the compiler often generates code that uses the functions of this library. If you, of course, do not use Win32 Projects. - 3JIoi_Hy6
      • There is nothing unusual. - Peter Taran

      Msvcr * .dll is the libraries supplied with the C ++ compiler. They contain, for example, memory allocation / release functions that run on top of WinAPI. Those. let's say, the WinAPI function is used to allocate pages of virtual memory to the process, and on the received pages, the malloc / free functions from msvcr create a heap and extract small pieces from it.

      Static linking is, of course, good, but sometimes creates other problems. For example, if the exe and the dll it uses are both linked to msvcr statically, you cannot allocate a piece of memory in exe and release it in the dll. To do without static linking, you must install the Microsoft Visual C ++ 2010 Redistributable Package. For example, http://www.microsoft.com/en-us/download/details.aspx?id=5555