Re: [tcljava-user] loading .so in Tcl that is created from Java
Brought to you by:
mdejong
From: Mo D. <md...@un...> - 2006-03-24 03:31:14
|
On Thu, 23 Mar 2006 17:30:20 -0700 Scott Serr <ss...@am...> wrote: > Hello Tcl Blenders, > > We are able to use TclBlend to create a (real, not Jacl) Tcl interpreter I will pretend you did not say that :) > from Java. We have LD_LIBRARY_PATH set. We eval a 'load foo.so' in > Tcl. This works, but foo.so is supposed to automatically load bar.so... > it doesn't. Well, first you should check the shared library to make sure the other shared libs it depends on are linked in. Exactly how you do that depends on the OS, but with Linux you should be able to use ldd. Sometimes the shared libs are not built properly and only the executables actually link in all the shared libs that are needed. > We are using Linux with Sun JDK 1.5.0_06. My cube-mate read that in > general Java didn't use the standard link loader. It even goes on to > say that automatic secondary loading might or might not happen. > > In short... > > Tcl starting the JVM, Tcl "load foo.so" also loads "bar.so" for us. > > JVM starting the Tcl Interpreter, Tcl "load foo.so" succeeds but fails > to load bar.so and has un resolved dependencies. > > Any ideas of how to solve this? We thought about combining our dozen or > so *.so files into one... Humm, another approach you can try is just loading the other shared libs before you load the one with the deps. Running load Tcl command with an empty string as the init method will raise an error, but it does do the OS load behind the scenes. I would give that a try and see if it fixes things before trying to rebuild libraries. I hope that helps Mo DeJong |