From the [Tcl chatroom] on 2002-01-16 (lost the beginning, though - it's on loading shared libraries that depend on other shared libraries): ... suchenwi: I see. But if you have libfootcl.so, which has a footcl_Init, and requires libbar.so, which requires libgrill.so? Is libfootcl then responsible for loading bar and grill? kennykb: It does it implicitly by having been linked with them. If I'm worried about the possibility of bar and grill being missing from the target system, I'll load them explicitly, so that the process won't abort if they are. lvirden: Richard, at least on Solaris, I can specify, when creating a .so shared library, that there are additional dependencies on other libraries that get resolved at load time. I have just that situation with oratcl. suchenwi: But it appeared as if Tcl's load mechanism tries to do the resolution, by calling the respective (libname)_Init function... but in vain. lvirden: In my case, the extra libraries are not Tcl libraries, but other related libraries. Someone else is going to have to address the specifics of tcl libraries calling other tcl libraries. kennykb: Tcl_PkgRequire from within the library, then use the package's Stub table... suchenwi: Do other packages besides Tcl have stub tables? I first heard the term in that context. What he wants to do is e.g. load libtiff, libz, or stuff like that. kennykb: Richard: I was answering Larry's question. TEA-compliant extensions with C API's have stub tables. Libtiff, he should just be able to link with. tclguy: incr Tcl has a stubs table. But Img does what you want, without any extra stubs stuff. Look at that. btw, extensions do not require their own stubs tables. TEA-compliant extensions USE the tcl and/or tk stubs tables. aku: Ok, libraries loading other libraries: 1) Tcl library requiring another Tcl library. Do 'package require' or the c-level equivalent to perform searching, loading and initialization 2) Tcl library requiring non-tcl library a) Link the tcl library against the other libraries and the OS will load them as necessary. Example OraTcl b) Plugin architecture, or no fixed library for a given functionality. Use dlopen, etc. to load the other libraries on-demand. Examples: Trf, TrfCrypt, Img. Regarding (2b) Jan Nijtmans proposed to expose platform independent interfaces to dlopen, dlsym, dlclose as part of the public api so that extensions like trf, img, etc. do not have to carry duplicate code around. Anyone caring enough to write up a TIP for this ?