Eclipse Java OpenCV unsatisfiedLinkError only in src test folder

There are no problems loading the library in my src main folder, but I get an error in the src test folder. I can still compile and run all the tests in normal mode, and they pass.

Both src folders are on the way, and I got opencv as a library. As I said, everything works, so I think the problem is with Eclipse and displaying an error that should not be displayed? Therefore, the main problem is that it is visually pain.

enter image description here

enter image description here

EDIT2: I just want to say again that everything works, the tests are all running, they just appear as problems (and I don’t see errors in the tests, because this unspecified linker darkens them before)

He also does the same on both my Windows and Ubuntu computers.

my path is also correct when I print it right before System.loadLibrary as ... / opencv -2.4.11 / build / lib

EDIT3: I tried Cibin William to answer and put my .dll path, but to no avail

enter image description here

+7
java eclipse opencv
source share
3 answers

Well, I reinstalled Eclipse and did it ... sigh

The error was on Eclipse Luna and Mars Version 4.5.1.

Mars Version 4.5.2 is working fine.

0
source share

You can directly on the project and click on Build Path β†’ Configure Build Path β†’, then select the Libraries tab and select the OpenCV jar file and then unlink it and then select on the Native Library Location and then click on Edit and then view the file .dll OpenCV .dll something like this C:\opencv\build\java\x64 or C:\opencv\build\java\x86 for a 32-bit system. And so it is.

Or you can load the library by encoding (dynamically)

 public static void loadOpenCV_Lib() throws Exception { // get the model String model = System.getProperty("sun.arch.data.model"); // the path the .dll lib location String libraryPath = "C:/opencv/build/java/x86/"; // check if system is 64 or 32 if(model.equals("64")) { libraryPath = "C:/opencv/build/java/x64/"; } // set the path System.setProperty("java.library.path", libraryPath); Field sysPath = ClassLoader.class.getDeclaredField("sys_paths"); sysPath.setAccessible(true); sysPath.set(null, null); // load the lib System.loadLibrary(Core.NATIVE_LIBRARY_NAME); } 
+2
source share

When I run the OpenCV program in eclipse, an unsatisfiedLInkError occurs. I solve the error by exporting the library path in eclipse as follows

1.Click on the project, select Debug as-> Debug configurations ...

2.Debug configuration window appears, select the Environment tab at the top

3.Click the New button on the right side of the window, the New environment variable window will appear

4. In the LD_LIBRARY_PATH Name Type field and in the Value field, enter the folder containing the DLL file (if .dll is present in the Lib folder inside the project, enter Lib in the value)

Please try to answer .....

0
source share

All Articles