15 messages in net.java.dev.jna.usersRe: [jna-users] linux libc link error
FromSent OnAttachments
QuartzOct 27, 2007 7:55 am 
Timothy WallOct 27, 2007 8:14 am 
QuartzOct 27, 2007 11:10 am 
Timothy WallOct 27, 2007 12:54 pm 
QuartzOct 28, 2007 11:03 am 
QuartzOct 28, 2007 12:44 pm 
Timothy WallOct 28, 2007 1:44 pm 
Timothy WallOct 28, 2007 1:49 pm 
Timothy WallOct 28, 2007 1:55 pm 
Timothy WallOct 28, 2007 2:30 pm 
QuartzOct 29, 2007 8:23 am 
Timothy WallOct 29, 2007 1:56 pm 
QuartzOct 29, 2007 7:39 pm 
Timothy WallOct 30, 2007 6:37 am 
QuartzNov 3, 2007 9:39 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] linux libc link errorActions...
From:Timothy Wall (twal@dev.java.net)
Date:Oct 28, 2007 2:30:30 pm
List:net.java.dev.jna.users

I've checked in a glibc 2.3.5-based build on the trunk. Try that one out.

On Oct 28, 2007, at 2:04 PM, Quartz wrote:

Hi,

Thanks for the info, Timothy. Yep, it's glibc 2.3.5. Before I go bother my linux guys with compilation, I'll push my luck: could you indicate where I could browse earlier binaries of jna, or at least a recent one that would be compiled against glibc 2.3.x?

Note:it would help the java user base to have a few builds at hand, with a disclaimer about the dependancies on the website. JNA is a great step forward for people like me that don't really handle platform dependant compilers.

--- Timothy Wall <twal@dev.java.net> wrote:

Looks like your system has an older glibc (probably 2.3) installed, and the jna.jar you have was compiled against glibc 2.4 (the current trunk binary build for linux uses glibc 2.3).

Do "/lib/libc.so.6" on the command line and it'll print the version of glibc in use.

On Oct 27, 2007, at 2:10 PM, Quartz wrote:

Hi,

//I made an interface Pthread.java: import com.sun.jna.Library; import com.sun.jna.Native; public interface Pthread extends Library { Pthread INSTANCE = (Pthread)Native.loadLibrary("pthread", Pthread.class); int pthread_self(); }

//And them I made a simple test class: public class TaskId { public static void main(String[] args) throws Exception { System.out.println("pthread_self() returned "+Pthread.INSTANCE.pthread_self()); } }

//Then I compiled and ran it, and got: javac -cp jna.jar *.java java -cp jna.jar:. TaskId

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/ jna47643.tmp: /lib/libc.so.6: version `GLIBC_2.4' not found (required by /tmp/jna47643.tmp) at java.lang.ClassLoader$NativeLibrary.load(Native Method) ...

What's going on? (forgive my lack of knowlege)

--- Timothy Wall <twal@dev.java.net> wrote:

I would guess linux uses pthreads, but you could browse the JVM source to be sure. I would imagine you might find what you're looking for in the native java.lang.Thread sources.

I'm inferring that task corresponds to thread, so if you make a pthread call to get the thread id, that might be what you're looking for.

The thread/task id might even be tucked away in a private member of a platform-specific class (this is the case with 1.6+ for AWT window handles).