title: Java LoadLibrary unresolved dependency but dependent dll is in same directory
body: <p>I'm having problems with Java loading a native dll, as it happens 64-bit Windows 7. FWIW the package is ZeroMQ but what matters is that the jar requires a native dll to load, called jzmq.dll. This in turn depends on libzmq.dll (and some standard libraries). I've copied both dlls into target/lib and set <code>java.language.path</code> to target/lib.</p>
  
  <p>If I write:</p>
  
  <pre><code>System.loadLibrary("jzmq");
  </code></pre>
  
  <p>I get an <code>UnsatisfiedLinkError</code> of <code>Can't find dependent libraries</code>. However if instead I say</p>
  
  <pre><code>System.loadLibrary("libzmq");
  System.loadLibrary("jzmq");
  </code></pre>
  
  <p>Then there is no problem and jzmq.dll loads successfully.</p>
  
  <p>Inside the accompanying jar it just has <code>System.loadLibrary("jzmq")</code> and I'd prefer not to have to fiddle with the dependency in my code. It's not clear to me why the dependency doesn't load automatically or what I'd need to do to get it to work properly.</p>
  
  <p>Thanks in advance for any help!</p>