How to make powershell tell me about missing DLLs?

后端 未结 3 533
有刺的猬
有刺的猬 2021-02-06 08:28

I use powershell as shell in Windows. When I\'m trying to launch some application who\'s dll dependencies are missing in PATH environment variable, then nothing happens, powersh

3条回答
  •  时光说笑
    2021-02-06 08:51

    I was having this same problem. PowerShell was setting $LASTEXITCODE code to -1073741515 (0xC0000142, 3221225794) but no output explaining what was actually wrong. When running it via cmd.exe I would get popup with something like:

    The code execution cannot proceed because some.dll was not found. Reinstalling the program may fix this problem.

    cygwin bash outputs errors relating to dll not found to stderr and if you run the the same via bash from PowerShell then you can see the error:

    > & 'C:\tools\cygwin\bin\bash.exe' '-c' '"C:/Users/xxx/dir/main.exe"'
    C:/Users/xxx/dir/main.exe: error while loading shared libraries: another.dll: cannot open shared object file: No such file or directory
    

    This works with git bash also:

    > & 'C:\Program Files\Git\bin\bash.exe' '-c' '"C:/Users/xxx/dir/main.exe"'
    C:/Users/xxx/dir/main.exe: error while loading shared libraries: another.dll: cannot open shared object file: No such file or directory
    

    Quite a hack but better than nothing.

提交回复
热议问题