How to link a msvcr120.dll in an inverse recursive way after a Windows .exe binary deployment

ShadoLight ettienne.gilbert at gmail.com
Sun Sep 4 22:05:24 UTC 2022


On Sunday, 4 September 2022 at 15:16:47 UTC, BoQsc wrote:
>
> **Folder structure**
>
> .\msvcr120.dll
> .\folder1\HelloWorld.exe
> .\folder2\HelloWorld.exe
>

You don't need to do this. msvcr120.dll is already shipped with 
the DMD compiler at 
[DMD-install-folder]\windows\bin64\msvcr120.dll. (It is also in 
[DMD-install-folder]\windows\bin). You can access it directly 
from there.

When you run your EXE... the OS looks for the DLL in the same 
folder of the EXE- if it cannot find it it looks in the folders 
specified in your PATH.

You can test if this is the case by executing 'where 
msvcr120.dll' at a DOS console command prompt. If the DLL is 
reachable in any folder in your PATH environment variable these 
specific path(s) will be displayed. In this case you don't need 
to do anything - the EXE should be able to run and load the DLL.

The fact that you get this error indicate this is not the case. 
You can do 1 of the following 2 things:
- add your DMD bin64 (or bin) path to the PATH environment 
variable.
--or--
- Copy the DLL to C:\Windows\System32\ - that will for sure 
already be in your PATH so you don't need to modify your PATH 
environment variable.


More information about the Digitalmars-d-learn mailing list