After I finally got my Java JNI code working on my Windows development machine that sets the local time of the computer from Java, I discovered it was not working on the production machine. I got the dreaded Unsatisfiedlinkerror - Can't Find Dependent Libraries runtime error. Following is an explanation of why it was happening and what I did to fix it...
The Cause - Visual Studio C++ 2010 Express
In order to find what dependent library was missing on the production machine that was present on my development machine, I downloaded and installed Dependency Walker. After analyzing my generated DLL I saw something unexpected.
What the heck is MSVCR100.DLL?? It turns out it's added by Visual Studio C++ during the build of the DLL, and it is NOT necessary.
There seem to be several solutions to this problem, but the most elegant in my opinion to to configure Visual Studio to not make the built DLL dependent on it in the first place. Here's how to do that: Right click on the DLL project and open up the properties dialog. Under Configuration Properties -> C/C++ -> Code Generation -> Runtime Library select "Multi-threaded (/MT)". source
Rebuild your DLL and verify with Dependency Walker that the rogue dependency is gone.