On Fri, 21 Jul 2000, Mike Schwartz wrote:

> Hi,
> 
> I decided to give the patch Mo mentioned below a try.  It works when I
> try it with Java executing some simple Tcl commands, but now I'm trying
> to use it with some pretty complex Tcl packages, and I get a
> tcl.lang.TclException that says:
> 
>      couldn't load file "/iw/tcl/current/lib/TclExpat-1.1/tclexpat.so":
>      ld.so.1:  /usr/java/bin/../bin/sparc/native_threads/java: fatal:
>      relocation error: file
>      /iw/tcl/current/lib/TclExpat-1.1/tclexpat.so: symbol
>      Tcl_GetStringFromObj: referenced symbol not found

Yikes. That is really odd. You might be running into some
goofy junk related to how the JVM loads shared libs and
how Tcl loads shared libs. For instance, you need to
load libtclblend.so in Tcl and in Java (with System.loadLibrary()),
but I do not know if that matters.

> Tcl_GetStringFromObj is a procedure defined in Tcl (in
> generic/tclObj.c), so somehow when I have Java invoke the Tcl
> interpreter it's not finding this routine.  I thought it might be a
> problem with my LD_LIBRARY_PATH causing it to load a version of Tcl
> that doesn't define this routine, but I truss'd the Java process and
> found that the version of the library that it's opening is
> /iw/tcl/current/lib/libtcl8.3g.so, and then I did the following:
>      % nm -og /iw/tcl/current/lib/libtcl8.3g.so | fgrep Tcl_GetStringFromObj
>      [2873]   |000002275540|000000000300|FUNC |GLOB 
> |0    |8      |Tcl_GetStringFromObj

Is there any chance that tclexpat.so is linked to another
Tcl shared lib?

Try running:

% ldd tclexpat.so

and see if that says something about libtcl8.3g.so in the link dep line.

> So, it seems the function *is* defined in the .so file it's accessing.
> 
> Any ideas what might be going on, or how I might try to debug it?

You might also want to try building tclexpat.so with stubs
support. That might work a little better.

Mo DeJong
Red Hat Inc

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to