From owner-freebsd-java Mon Dec 24 3:52:23 2001 Delivered-To: freebsd-java@freebsd.org Received: from shikima.mine.nu (pc1-card4-0-cust77.cdf.cable.ntl.com [62.252.49.77]) by hub.freebsd.org (Postfix) with ESMTP id A857337B419 for ; Mon, 24 Dec 2001 03:52:20 -0800 (PST) Received: from rasputin by shikima.mine.nu with local (Exim 3.33 #1) id 16ITgu-0001rO-00; Mon, 24 Dec 2001 11:54:48 +0000 Date: Mon, 24 Dec 2001 11:54:48 +0000 From: Rasputin To: Hans Lambermont Cc: java@freebsd.org Subject: Re: JNI, -pthread vs -lc_r Message-ID: <20011224115448.A7117@shikima.mine.nu> Reply-To: Rasputin References: <200112232058.VAA10405@www.blender.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200112232058.VAA10405@www.blender.nl>; from hans@blender.nl on Sun, Dec 23, 2001 at 09:58:00PM +0100 Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org * Hans Lambermont [011223 21:05]: > Joe wrote: > > Hans Lambermont writes: > > > Linking a JNI .so with only -pthread seems insufficient. I get: > > > Exception in thread "main" java.lang.UnsatisfiedLinkError: > > > libblenderssr.so: > > > /usr/X11R6/lib/libGL.so.1: Undefined symbol "pthread_getspecific" > Sorry that I was not clear. I created my own .so file and access > it from java by using the JNI. > When not using java, running the program (with the c main() still present) > the program runs fine (linking with -pthread). > > When creating the shared object however (and removing the c main() function), > -pthread is not enough at runtime. -lc_r is also required. > > My question is 'why is this ?'. My educated guess would be the the JVM wasn't built with the -pthread flag - so Java doesn't recognize the symbols used by libGL. I'm not too hot on the ins and outs of C libraries or JNI, but I've seen the same error with things that I've tried to build against Mesa. [ Happy Christmas to all on list, incidentally. And thanks to 'Santa' Nate for the licensed JVM ;) ] -- Rasputin :: Jack of All Trades - Master of Nuns :: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message