nativelibs4java / JNAerator

JNAerator: native bindings generator for JNA / BridJ / Node.js
http://jnaerator.googlecode.com
507 stars 109 forks source link

jnaerator seems to require specific glibc version #60

Open ochafik opened 9 years ago

ochafik commented 9 years ago

From @mineralwasser on March 17, 2014 11:29

This is the output of the most recent jnaerator snapshot, 0.11 works:

 [java] Caused by: java.lang.UnsatisfiedLinkError: /tmp/BridJExtractedLibraries2732055613940647667/libbridj.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/BridJExtractedLibraries2732055613940647667/libbridj.so)
 [java]
 [java]     at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 [java]     at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
 [java]     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
 [java]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
 [java]     at java.lang.Runtime.load0(Runtime.java:795)
 [java]     at java.lang.System.load(System.java:1062)
 [java]     at org.bridj.Platform.initLibrary(Platform.java:419)
 [java]     ... 5 more
 [java] Exception in thread "main" java.lang.UnsatisfiedLinkError: org.bridj.Platform.sizeOf_ptrdiff_t()I
 [java]     at org.bridj.Platform.sizeOf_ptrdiff_t(Native Method)
 [java]     at org.bridj.Platform.<clinit>(Platform.java:231)
 [java]     at com.ochafik.lang.jnaerator.NativePlatform.getCurrentPlatform(NativePlatform.java:49)
 [java]     at com.ochafik.lang.jnaerator.JNAerator$1.<init>(JNAerator.java:226)
 [java]     at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:224)
 [java]     at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:197)

Copied from original issue: ochafik/nativelibs4java#484

ochafik commented 9 years ago

From @washley on March 19, 2014 23:24

See https://github.com/ochafik/nativelibs4java/issues/467

ochafik commented 9 years ago

From @mineralwasser on March 20, 2014 17:26

Although it's the same exception as #467 , I'd like to point to another thing here: I'm not targeting to bridj (but to JNA), why to I have to bother with Bridj libs at all?

The answer lies within this method:

 com.ochafik.lang.jnaerator.NativePlatform.getCurrentPlatform()

Unfortunately, this method depends on the native bridj libraries, which is bad. It could be so easy just providing the currrent platform via argument or using another techniques for detecting the platform but according to the source code, there's no alternative way.