I read that dependency walker is no longer reliable since Windows 7 (it gives false negatives). When LoadLibrary fails either the dll that you try to load can't be loaded or a dependency dll.
When you open your project in visual studio, you can pause the the debugger at LoadLibraryW(Filename); Call GetLastError() to find out the exact problem as suggestion here LoadLibraryW() failing to load DLL in System32 if you can modify the source code and recompile.
Now to find out the which DLL is missing you must use the Windows Debugging tool GFLAGS https://msdn.microsoft.com/en-ca/library/windows/hardware/ff549557(v=vs.85).aspx. GFlags is included in Debugging Tools for Windows (I don't know where to get windows debugging tools from. Maybe try https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk).
Again unfortunately nobody writes down a good manual how to use it. So these are the steps:
- Assuming windows 10 (64-bit), and Windows debugging tools are installed.
- After installing SDK, restart
- Then click on the windows icon and type 'GFLAGS'
- Open "Global Flags (X64) - Desktop App"
- Enable Show loader snaps in the "Global Flags" dialog in the "System Registry"-tab (second entry, topleft)
- restart (Yes you must restart!)
- Open visual studio with your solution file.
- Run it in debug mode (Win64)
- Let the application run through the error
- Stop the application and Close the debugger
- Now in the visual studio, Go to the Output pane. And select: Show output from: "Debug"
Examine the last line of the output. Somewhere there will be an entry with ERROR in it. Mine read:
14b0:15ec @ 00131328 - LdrpSearchPath - RETURN: Status: 0xc0000135
14b0:15ec @ 00131328 - LdrpProcessWork - ERROR: Unable to load DLL: "clAmdFft.Runtime.dll", Parent Module: "C:\Users\steven\Documents\Unreal Projects\Revaro 4.11\Binaries\Win64\UE4Editor-Revaro.dll", Status: 0xc0000135
14b0:15ec @ 00131328 - LdrpLoadDllInternal - RETURN: Status: 0xc0000135
14b0:15ec @ 00131328 - LdrLoadDll - RETURN: Status: 0xc0000135
'UE4Editor.exe' (Win32): Unloaded 'C:\Windows\System32\mfreadwrite.dll'
"clAmdFft.Runtime.dll" This is the DLL that is giving problems. Either install it, the filepath is valid and configured in the project, make sure it is not corrupt and the right version x86/x64.
In my case I added this library myself for the custom code I was using.
Now disable the GFLAGS again, because it will slow down your computer and restart.