Fix lỗi failed to get dll from server năm 2024

My application written in VS2005 is a 32 bit software. It runs fine on Windows server 2008, windows 7 (64 bit) but does not run on Windows server 2012. I tried to find out which DLL is missing because I get an error from LoadLibrary "A dynamic link library (DLL) initialization routine failed". The code giving error is as under

m_plugin = LoadLibrary( pluginPath.c_str() );
if ( !m_plugin )
{
    const string error( "Failed to load Library \"" + pluginPath + "\" " +  GetLastErrorStdStr() );
    CBLogger::log( error, HIGH_IMPORTANCE );
    return false;
}

To fix the problem I have tried installing C++ redistributable version 8.0.61001 but it did not help.

I even looked at dependency walker (I am really new to it) and did find some windows dlls (eg msvcr80.dll) which were shown in yellow. I copied those into my application folder but that did not work either.

Could some one please give any ideas as to how should I resolve this? What version of redistributable should I install or some tips on how to use dependency walker. Please help

asked Oct 27, 2014 at 8:25

user2837961user2837961

1,5453 gold badges30 silver badges68 bronze badges

7

Try to check windows events log. It is somewhere around Control Panel -> Administrative Tools -> Event Viewer -> Windows Logs -> Application. Usually you'll see there the exact DLL that was not found with expected version that should also match.

answered Oct 27, 2014 at 9:06

Fix lỗi failed to get dll from server năm 2024

dewaffleddewaffled

2,8782 gold badges18 silver badges30 bronze badges

Yes Somehow the LoadLibrary fails, if the DLL does not have the DLLMain function, in Windows Server 2012. To solve this you can use:

LoadLibraryEx(libraryname, NULL, DONT_RESOLVE_DLL_REFERENCES).

Fix lỗi failed to get dll from server năm 2024

danopz

3,3305 gold badges31 silver badges42 bronze badges

answered Apr 11, 2016 at 12:47

NaveenNaveen

231 silver badge9 bronze badges

Probably the dll can't be load because the error: "An attempt was made to load a program with an incorrect format.". A dll build with platform taget "x86" work fine in a Win 7 x86 or x64 but don't work in a Win 2012 Server x64. Compile the dll with platform target "Any CPU"

answered May 28, 2015 at 16:28

Fix lỗi failed to get dll from server năm 2024

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:

  1. Assuming windows 10 (64-bit), and Windows debugging tools are installed.
  2. After installing SDK, restart
  3. Then click on the windows icon and type 'GFLAGS'
  4. Open "Global Flags (X64) - Desktop App"
  5. Enable Show loader snaps in the "Global Flags" dialog in the "System Registry"-tab (second entry, topleft)
  6. restart (Yes you must restart!)
  7. Open visual studio with your solution file.
  8. Run it in debug mode (Win64)
  9. Let the application run through the error
  10. Stop the application and Close the debugger
  11. Now in the visual studio, Go to the Output pane. And select: Show output from: "Debug"
  12. 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.