jnr / jffi

Java Foreign Function Interface
Apache License 2.0
168 stars 78 forks source link

No-ascii Windows username cause UnsatisfiedLinkError exception #70

Closed BillionsRichard closed 5 years ago

BillionsRichard commented 5 years ago

at com.kenai.jffi.Foreign.newLoadError(Foreign.java:72) at com.kenai.jffi.Foreign.access$300(Foreign.java:42) at com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:98) at com.kenai.jffi.Foreign.getInstance(Foreign.java:103) at com.kenai.jffi.Library.openLibrary(Library.java:157) at com.kenai.jffi.Library.getCachedInstance(Library.java:131) at org.python.modules.jffi.DynamicLibrary.(DynamicLibrary.java:26) at org.python.modules.jffi.jffi.dlopen(jffi.java:43) 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:498) java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: C:\Users\Sa?ol\AppData\Local\Temp\jffi946630297317024306.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1086) at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:371) at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258) at com.kenai.jffi.internal.StubLoader.(StubLoader.java:444) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at com.kenai.jffi.Init.load(Init.java:68) at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) at com.kenai.jffi.Foreign.getInstance(Foreign.java:103) at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242) at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237) at com.kenai.jffi.Type.resolveSize(Type.java:155)

I'm using jython-standalone-2.7.1.patch2609.jar depending com.kenai.jffi.internal.StubLoader does, the root cause is the defact of System.load() function can not handle no-ascii path param. see: libgdx/libgdx#5524

headius commented 5 years ago

Thank you for the report and PR, and sorry for the delay! This should be released later today.