2014-06-13 8 views
6

मैं एलपी हल करने के लिए नया हूँ। मैं निम्नलिखित कोड को चलाने के लिए कोशिश कर रहा हूँ और निम्न त्रुटि हो रही है:java.lang.UnsatisfiedLinkError: निर्भर पुस्तकालयों को नहीं मिल सकता

package package1; 

/** 
* Created by ANJANEY on 6/13/2014. 
*/ 

import lpsolve.*; 

public class Demo { 

    public static void main(String[] args) { 
     try { 
      // Create a problem with 4 variables and 0 constraints 
      LpSolve solver = LpSolve.makeLp(0, 4); 

      // add constraints 
      solver.strAddConstraint("3 2 2 1", LpSolve.LE, 4); 
      solver.strAddConstraint("0 4 3 1", LpSolve.GE, 3); 

      // set objective function 
      solver.strSetObjFn("2 3 -2 3"); 

      // solve the problem 
      solver.solve(); 

      // print solution 
      System.out.println("Value of objective function: " + solver.getObjective()); 
      double[] var = solver.getPtrVariables(); 
      for (int i = 0; i < var.length; i++) { 
       System.out.println("Value of var[" + i + "] = " + var[i]); 
      } 

      // delete the problem and free memory 
      solver.deleteLp(); 
     } 
     catch (LpSolveException e) { 
      e.printStackTrace(); 
     } 
    } 

} 

त्रुटि:

Exception in thread "main" java.lang.UnsatisfiedLinkError:E:\HIVEMINDS\ThirdProject\lp_solve_5.5.2.0_dev_win64\lpsolve55j.dll: Can't find dependent libraries 
at java.lang.ClassLoader$NativeLibrary.load(Native Method) 
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957) 
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882) 
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1872) 
at java.lang.Runtime.loadLibrary0(Runtime.java:849) 
at java.lang.System.loadLibrary(System.java:1087) 
at lpsolve.LpSolve.<clinit>(LpSolve.java:275) 
at package1.Demo.main(Demo.java:14) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) 
+1

एक नजर डालें [यहां] (http://stackoverflow.com/questions/6092200/how-to-fix-an-unsatisfiedlinkerror-cant-find-dependent-libraries-in-a-jni-pro) – Jens

उत्तर

3

क्या आप वाकई System.loadlibrary साथ अन्य वर्गों में सही लायब्रेरी लोड कर रहे हैं?

यदि हाँ, मुझे लगता है कि त्वरित समाधान सभी पुस्तकालयों (उदाहरण के system32 के लिए, खिड़कियां) कि ओएस के पथ में मौजूद है एक फ़ोल्डर में डाल हो सकता है यह मेरे लिए हर काम किया है, तो कोई किसी अन्य मुद्दे

संबंधित मुद्दे