• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't find dependent libraries

 
Peter Chase
Ranch Hand
Posts: 1970
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed from Microsoft Visual C++ (MSVC) 6 to MSVC 8 for building the native bits of my Java application on Windows. I now get the following at run-time: -

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\users\peterc\hoperoot\trunk\jdfservices\javalicence\obj\win_32-pentium\a-a\msvcnt_8_0\EncryptTool.dll:Can't find dependent libraries

Note that this is not the message you get if Java cannot find the native library (DLL) implementing the native method it's trying to link. I have verified that, if I remove my DLL, I get a different message. Therefore, I conclude that it can find my DLL, but it cannot find some DLL on which my DLL depends.

I looked at my DLL in Windows Depends.exe tool. The only DLL that this couldn't find was DWMAPI.DLL. That's a Vista-specific DLL that ought not to get loaded on my XP box; lots of other programs that work fine have such a dependency, so I think DWMAPI.DLL is a "red herring".

Someone suggested running my program in a native debugger and putting a breakpoint on LoadLibrary() calls, but I haven't been able to work out how to do that.

Anyone have any bright ideas?
 
gomathishankar
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can download this free software dependency walker which tells you what are all the dlls on which your dll depends...i faced this problem too and got it solved through dependency walker
 
Peter Chase
Ranch Hand
Posts: 1970
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was already using Dependency Walker (see where I referred to "Depends.exe").

The problem was to do with some darn-awful Windows confection called "manifest files". This is something that tells the OS where to find run-time dependency libraries. This is necessary for the C run-times compiled under MSVC 8.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic