[vtkusers] libvtkJava and libXt

Peter F Bradshaw pfb at users.sourceforge.net
Mon Jan 15 21:01:07 EST 2001


Hi Prabhu;

On Sun, 14 Jan 2001, Prabhu Ramachandran wrote:

> hi,
> 
> >>>>> "Peter" == Peter F Bradshaw <pfb at users.sourceforge.net> writes:
> 
>     Peter> Hi; I'm having problems with the vtkJava library. The test
>     Peter> code I'm using is:
> 
> <snip>
> 
>     Peter> If I comment out the System.loadLibrary("Xt") then I get an
>     Peter> unsatisfied link error from the virtual machine as follows:
> 
>     Peter> Exception in thread "main" java.lang.UnsatisfiedLinkError:
>     Peter> /usr/local/vtk/lib/libvtkJava.so:
>     Peter> /usr/local/vtk/lib/libvtkJava.so: undefined symbol:
>     Peter> XtAppMainLoop at
> 
> This is very strange!  This is because, XtAppMainLoop is defined in
> libXt.so (at least it is defined in my copy) and your libvtkJava.so is
> dynamically linked to libXt.
> 
> $ strings /usr/X11R6/lib/libXt.so.6.0 |grep XtAppMainLoop
> XtAppMainLoop
> $
> 
> So, is your libXt corrupt?

No - I don't think so. I've reinstalled this library from the distribution
(RH6.1) cdrom. Also I use this library quite heavily elsewhere. XtAppMainLoop
is used quite frequently by many packages. 

This is my first use of both Java and Vtk so I'm inexperienced in both. One 
thing I notice that there is very little discussion on the net of Java and 
Vtk together. I'm wondering whether anybody has sucessfully used the two
together.

> 
> <snip>
>     Peter> Sorry about the verbosity of the outputs but too much is
>     Peter> probably better than too little. My firtst question is that
>     Peter> given that vtkJava is to be linked to Xt (ldd) then is the
>     Peter> System.loadLibrary("Xt") statement necessary at all? And,
>     Peter> if it is what is causing the SIGSEGV?
> 
> I dont think you need to load libXt again.  Could this be because
> there is some problem with the order in which the libraries are
> linked?

Since I wrote the original mail I've tried the code with Sun's JDK (r1.3). The
original was done with the corresponding package from IBM. With the Sun package
I get the linkage error whether I include the System.loadLibrary("Xt") 
statement or not. Despite this I think my problem is more likely to do with
the way that I've compiled the Vtk library. This was done by

./configure  --prefix=/usr/local/vtk --with-mesa --with-tcl --with-java --with-shared

and I have added 

X_EXTRA_LIBS=-lXt

to user.make. The X_EXTRA_LIBS is needed to get the linkage to libXt from
libvtkJava reported by ldd.

Cheers

--
Peter F Bradshaw          | http://members.dingoblue.net.au/~pfb
pfb at users.sourceforge.net | PGP public key at
http://www.pfb.tsx.org    | http://members.dingoblue.net.au/~pfb/public_key.html
ICQ 75431157 (exadios)    | "Needs more salt" - Archimedes






More information about the vtkusers mailing list