luben / zstd-jni

JNI binding for Zstd
Other
867 stars 169 forks source link

"Can't find dependent libraries" on Windows #24

Closed kbotond closed 8 years ago

kbotond commented 8 years ago

Zstd library cannot be loaded at some of our customers due to a missing dependency. The customers use Windows 7 & 8.1 with 32-bit Java 8.

Stack trace: java.lang.UnsatisfiedLinkError: C:\Users\gaileri\AppData\Local\Temp\libzstd5953396159493472756.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[na:1.8.0_101] at java.lang.ClassLoader.loadLibrary0(Unknown Source) ~[na:1.8.0_101] at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[na:1.8.0_101] at java.lang.Runtime.load0(Unknown Source) ~[na:1.8.0_101] at java.lang.System.load(Unknown Source) ~[na:1.8.0_101] at com.github.luben.zstd.util.Native.load(Native.java:78) ~[commons3.jar:na] ...

Maybe some MS Visual C runtime is needed for loading the zstd dll? Could it be included in the jar file?

luben commented 8 years ago

It's compiled with the MSYS/gcc toolchain, not MS Visual C. I don't have access to windows and I don't know what's missing.

kbotond commented 8 years ago

Examining the dll with Dependency Walker revealed that it has a dependency named 'LIBGCC_S_DW2-1.DLL'. But this is only true for the 32-bit version. The 64-bit one does not have such dependency.

luben commented 8 years ago

Thanks for the investigation. Looks I have to add "-static-libgcc -static-libstdc++" to the compiler flags

luben commented 8 years ago

I have pushed a new build with hopefully fixed win/x86 binary. It will become public on maven central in 3-4 hours. Can you try it?

kbotond commented 8 years ago

Thanks. Could you build it with Java 7 compatibility? Versions 1.1.0 & 1.1.1 were Java 7 compatible and there don't seem to be any Java 8 features used in the source code.

luben commented 8 years ago

You are right. I am pushing a new build now. You can try it in 3-4 hours

kbotond commented 8 years ago

It's still built for Java 8.

luben commented 8 years ago

yes, you are right, pushing now a build with java7, should be public in 3-4 hours

kbotond commented 8 years ago

Thank, it works perfectly.

Layamp commented 7 years ago

moring every body. I'm developping an application with netbeans and ArcGIS SDK 100.0.0 library and i'm facing a problem when compiling the code. The problem is that while comiling, have the following Stacktrace and I don't know what to do. Please any Help? thanks.

Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:363) at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:303) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767) Caused by: java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(LauncherImpl.java:157) at com.sun.javafx.application.LauncherImpl$$Lambda$48/1555093762.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.UnsatisfiedLinkError: C:\Users\Hamidou\Documents\NetBeansProjects\MyMapApp\jniLibs\WIN64\vcruntime140.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1083) at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.a(SourceFile:547) at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.b(SourceFile:555) at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.h(SourceFile:537) at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.initialize(SourceFile:162) at com.esri.arcgisruntime.internal.jni.CoreMap.(SourceFile:46) at com.esri.arcgisruntime.mapping.ArcGISMap.(SourceFile:287) at DemoApp.MyMapApp.start(MyMapApp.java:32) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821) at com.sun.javafx.application.LauncherImpl$$Lambda$51/1536038496.run(Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323) at com.sun.javafx.application.PlatformImpl$$Lambda$45/501263526.run(Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292) at com.sun.javafx.application.PlatformImpl$$Lambda$47/1433145973.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291) at com.sun.javafx.application.PlatformImpl$$Lambda$46/1099983479.run(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102) at com.sun.glass.ui.win.WinApplication$$Lambda$37/1732398722.run(Unknown Source) ... 1 more Exception running application DemoApp.MyMapApp Java Result: 1 BUILD SUCCESSFUL (total time: 2 seconds)

luben commented 7 years ago

I don't see this package mentioned in the stacktrace. So I don't see how it can be caused by the zstd.

If you find compelling evidence it's caused by zstd, please open a new issue as I am not usually looking the closed ones.