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
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 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:
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 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:
"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. |