*
The moose likes General Computing and the fly likes JNI try to Access native DLL and get Can't find dependent librarie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "JNI try to Access native DLL and get Can Watch "JNI try to Access native DLL and get Can New topic
Author

JNI try to Access native DLL and get Can't find dependent librarie

ashish donvir
Greenhorn

Joined: Mar 01, 2012
Posts: 25
I have Visual Studio 2010 installed and have a c++ project( or Driver)which I got with my hardware which I can build successfully without any errors. I get a Wrapper.dll, which I would like to access using JNI in order to use with java as my whole application is in java. I am using Win7 64-bit.

But I get the error: java.lang.UnsatisfiedLinkError: Unable to load library 'Wrapper': The specified module could not be found.

Wrapper.dll of course is in the correct folder and it is a 32-bit dll and my Java program also uses a JRE with 32-bit, so this is not the cause of the error.

I used DependencyWalker to check whether *.dlls are missing: And I got these dll missing

MSVCR80.DLL
IESHIMS.DLL
GPSVC.DLL

And yes there are some missing. Can I conclude that the error is related with that these DLLs are missing? But why does Visual Studio compile correctly then and does not throw an error? How to solve this in order to access these functions in Wrapper.dll?

I also read that downloading dll's might not be the right thing to do! (I know that Wrapper.dll relies on another dll or sourcecode which was built in Visual Studio 2005, if that is of interest.)



I found out, that Wrapper.dll relies on three other dlls which probably were built on MSVS2005. These require the above mentioned DLL's (checked with dependencywalker) and I guess therefore Wrapper.dll also links them.

So what do I actually do to get rid of these old dll's? Would I need to build the other three DLLs with VS2010 or is this a problem which always will appear, meaning, that you need to copy paste old DLLs in order to use the precompiled Libraries which are dependent on those.

Is there a way, that the program would run on any other system as well without copy pasting these DLL's?
Is This A Good Question/Topic? 0
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

As this question isn't in any way related to Swing / AWT / SWT / JFace, I'm moving the thread to General Computing.


luck, db
There are no new questions, but there may be new answers.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

ashish, you have earlier been asked to BeForthrightWhenCrossPostingToOtherSites
http://stackoverflow.com/questions/10519208/jna-try-to-access-native-dll-and-get-module-not-found-error-dependencies-are-mi
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Can I conclude that the error is related with that these DLLs are missing?

Yes. Unfortunately the error message never tells you exactly which DLL is missing - it could be either that it cannot find the DLL you specified, or it cannot find a DLL upon which that DLl depends. You might be able to use Process Monitor from sysinternals to see which DLLs the JVM is attempting to open, and thus determine which one was missing.

But why does Visual Studio compile correctly then and does not throw an error?

That depends on a number of things. Andi t has a lot do do with what kind of DLLs they are (.NET, or plain C/C++). Usually, with C/C++ development, all you need is the header files and .lib file to make the compiler and linker happy. It's not until you run the app that you need to .dll file.

Essentially, you will need those DLLs unless you can modify Wrapper.dll to no longer rely on them.


JBoss In Action
 
 
subject: JNI try to Access native DLL and get Can't find dependent librarie
 
Similar Threads
Configuring eclipse to use dll files at runtime
How do call the function from .dll file in java
UnsatisfiedLinkError in my first JNI program
creating dll
Windows 98 + Oracle8i + jdbc +