My java 1.5 application (running on Windows 7) accesses btrieve files, from Pervasive Software (PVSW). I use a JAR file supplied by PVSW, named psql.jar. This JAR accesses several DLLs. Most of the time my application runs without error, but sometimes, on the initial load of the JAR file I get a java exception:
jnibtrv.dll - cannot find dependent libraries
Restarting the computer fixes the problem - until the next time it happens.
I have profiled my application with "Dependency Walker" (version 2.2). The error did not occur during profiling, but it also didn't even show that file jnibtrv.dll was loaded.
How can I find what dependent library is missing?
Related
Some of our users have been complaining about a libmmd.dll not found error on our plugins loading.
Some background:
I'm talking about an issue occurring on Windows (8, for that matter).
We develop plugins for Digital Audio Workstations (for digital sound
processing purposes).
Our plugin is a DLL coded in VS2012 and compiled with Intel Compiler 2015 via Perl scripts calling icl.exe
from the cmd.
One of its dependencies is an Intel-supplied math
library provided in the 2015 flavor of its redistributables (which we
install together with our plugins) called libmmd.dll.
For a matter of convenience, let's call the plugin DLL plugin.dll (!!!).
I didn't have much time on one of the affected users' machine but from what I saw, reinstalling Intel's redistributables package didn't help, only moving libmmd.dll to the same folder as plugin.dll.
Whatever the reason for this (sudden and unexpected) behavior, we want to be able to deliver software protected against this kind of issues (DLL Hell).
What we want is for plugin.dll to look for libraries first in a specific directory (configurable would be even better), then in its usual search order.
I tried playing with manifests, registry, library names, linker options...
The only things that actually worked were switching the /MD option with /MT (but recompiling with static libs really adds to the size of plugin.dll) and copying the library to the folder plugin.dll is in.
Any ideas ?
Thanks !
The SetDllDirectory function lets you add a folder path to the DLL search order. It will be added in second place, immediately behind the program folder itself.
This only affects DLLs loaded via LoadLibrary however; if your DLLs are loaded statically it won't make any difference.
We have .NET application which uses C++ library via [DllImport]. It works fine on many computers (thousands of customers) excepting 3 computers. All of them have Windows 10 installed (other Windows 10 platforms work fine).
The exception is:
System.DllNotFoundException: Unable to load DLL 'Helper.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
This dll places in the same folder as main executable file.
What already done to fix:
put DLL in system32 folder;
installed different version of vc redist;
run as administrator.
The result is the same.
Any ideas, guys?
Thanks in advance!
Don't put the DLL in the system directory. You aren't supposed to put files there. Put the DLL in the same directory as the executable.
If you do that and the system reports DllNotFoundException that means one of the DLL's dependencies could not be found. Next you need to find out what the dependencies are, and make sure that they are all met.
You can use a tool like Dependency Viewer to check the dependencies, but really the best way to do this is to go to the source. Either the documentation of the library if it is a third party library, or direct from the source code and compilation options if you have built the DLL yourself.
The DLL (my.dll) is loaded by the Windows Time Service. It has an associated log, which is registered with the windows event logging service with wevtutil im mymanfile.man.
I rebuilt the project with VS12 libraries and am now having a problem with my.dll loading. It's not touched at all - no logging occurs, remote debugging doesn't work because it's not being loaded.
I have looked at it with dependency walker and resolved most of the dependency issues, except a bunch of API_MS_WIN_* dependencies, which I think are just noise and not actually root cause.
I need some more help figuring out what can cause a "The specified module could not be found 0x8007007E" error in the system logs. How does Windows determine a DLL is not loadable? What could be missing when I changed from vs10 to vs12 libraries? What's the Windows procedure for loading a DLL for a service (such as w32time)?
It looks like you may be missing C++ runtime DLLs.
Give this program a try: http://www.dependencywalker.com
I found out what the answer to this issue was:
The w32time time service was unable to load the .dll. The reason why is that the load order goes: 1) current working directory 2) system path 3) default system directory.
My problem was the current working directory was NOT the place where the DLL actually was. I needed to add my path to PATH in order for the system to find it.
The solution was simply set PATH = %PATH%/dir_where_dll_lives
I have developed a Java applet that loads my C++ dll through the loadLibrary function. From there, my applet calls some native methods that are implemented in the C++ code. I have created an InstallShield installer that puts the C++ dll in the required location on my client computers.
Everything works just fine on my development PC, but when I try testing on a "fresh" client computer that does not have anything but the JRE installed, I am getting an UnsatisfiedLinkError: Can't find dependent libraries. I don't know if there is something else I need to include. I checked using DependencyWalker and below is what I saw.
Is there anything out of the ordinary that a fresh windows install would not include? What else can I do to determine what dependency my dll cannot find on the client?
My application contains an c++ exe file which invokes a java program using JNI, thus requiring jvm.dll. However, I want my application to ship with its own embedded jre but after I copy the jre6 folder found in JAVA_HOME and added it to my installer, it fails to run the program(Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries), when I use dependency walker on jvm.dll, it says that it can't find gpsvc.dll, IEShims.dll and sysntfy.dll. After I tried copying those dlls to the same folder as jvm.dll, dependency walker tells me that gpsvc.dll andsysntfy.dll is 64 bit where it should be x86. Problem is, those were the only dlls on my system, what should I do?
The Java virtual machine consists of much more than just jvm.dll. You'll need to redistribute the whole JVM package and install that on a user's machine instead of just adding jvm.dll to your own application.
It will probably be much easier to require your users to download and install the JVM themselves before installing your application. If you really want to redistribute the JVM with your application, you'll need to find documentation on Oracle's website on what the exact license for that is and on how to do it. Look at this paragraph of the JDK 6 readme, for example.
It's not as simple as copying jvm.dll and other libraries that it depends on.
You may download the required dll's from the appropriate sites, i.e. from this one.