Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsatisfiedLinkError #39

Closed
rosenjcb opened this issue Oct 31, 2018 · 4 comments
Closed

UnsatisfiedLinkError #39

rosenjcb opened this issue Oct 31, 2018 · 4 comments

Comments

@rosenjcb
Copy link

rosenjcb commented Oct 31, 2018

I get this error when running my OpenCV project:

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/opencv_openpnp6038665475955000750/nu/pattern/opencv/linux/x86_64/libopencv_java320.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/opencv_openpnp6038665475955000750/nu/pattern/opencv/linux/x86_64/libopencv_java320.so: /tmp/opencv_openpnp6038665475955000750/nu/pattern/opencv/linux/x86_64/libopencv_java320.so: cannot enable executable stack as shared object requires: Invalid argument
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at nu.pattern.OpenCV$SharedLoader.<init>(OpenCV.java:204)
        at nu.pattern.OpenCV$SharedLoader.<init>(OpenCV.java:185)
        at nu.pattern.OpenCV$SharedLoader$Holder.<clinit>(OpenCV.java:225)
        at nu.pattern.OpenCV$SharedLoader.getInstance(OpenCV.java:229)
        at nu.pattern.OpenCV.loadShared(OpenCV.java:179)
        at com.pdfextract.common.App.<clinit>(App.java:14)

I also have this at the top of my App.java (main class):

static { 
	nu.pattern.OpenCV.loadShared();
	System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);
}	

I have not downloaded and installed opencv, but I am under the impression that this should work without having to manually install and link the lib. What should I do?

@rosenjcb
Copy link
Author

This seems to be an WSL issue. I might close this post unless someone else has other input to give.

@vonnieda
Copy link
Member

vonnieda commented Nov 1, 2018

This is likely a duplicate of #38. Try using version 2.4.11-2 and see if it works. That version is known to be stable on all platforms.

@rosenjcb
Copy link
Author

rosenjcb commented Nov 2, 2018

@vonnieda Imagecodecs is not a usable import if I use version 2.4.11-2

@vonnieda
Copy link
Member

This is now fixed as part of #33.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants