Hi Brian,
This is a dangerous path on several levels. If the libtcl.so you load
isn't the exact same one used by Tcl::Tk, you can have all sorts of
conflicting library issues. The issue that you are hitting is regarding
Tcl's stubs mechanism. This is the mechanism that provides a high level
of binary version independent, but also enables the single-file
dll/executable features of Tcl. More about stubs at:
http://wiki.tcl.tk/285
BLT, while a nice fancy widget package, is well known to not support the
stubs interface (in large part because it pokes deeply into Tcl/Tk
internals, which mostly aren't exposed by stubs). If you are using a
Tcl/Tk through Tcl::Tk that isn't a single-file dll (such as the one
shipped in ActivePerl for user convenience), then you should be OK, as
long as you compile BLT against that Tcl/Tk.
Let me know if you have any more questions on that.
Regards,
Jeff
Brian Bevins wrote:
Vadim and Jeff,
I am a colleague of Michele's here at Jefferson Lab. I built the
versions of Tcl and Tcl::Tk that she is having trouble with. Thank you
for responding so promptly to our questions.
Our initial build of Tcl:Tk 0.97 failed because our version of Perl
(5.8.2) has an Exporter that lacks the import method. That method was
introduced with the Exporter that shipped with Perl 5.8.3. I had to go
back to Tcl::Tk 0.91 to find a version that did not require the
Exporter->import() method. That one built just fine and passed all its
tests. We can use this until our sysadmins give us a new version of Perl.
The problem loading BLT under Tcl or Tcl::Tk is completely separate. It
seems that both libblt24.so and libbltlite24.so depend on symbols from
libtcl8.4.so. As built out of the box, the BLT libraries do not
explicitly force the Tcl library to be loaded. They seem to expect that
Tcl will already be loaded. Normally this is the case and BLT works fine
when used directly from tclsh or wish, but for some reason under Tcl and
Tcl::Tk this is not the case.
When I look at the Tcl.so library for Perl, it does indicate an explicit
dependency on libtcl8.4.so. But for some reason "use Tcl" (or "use
Tcl::Tk") does not force libtcl8.4.so to load. I have worked around this
in Perl for the time being by loading it explicitly as:
use Tcl::Tk;
my $m = Tcl::Tk::MainWindow->new();
my $i = $m->interp();
$i->Eval('load /usr/csite/pubtools/tcl/8.4/lib/libtcl8.4.so Tcl');
$i->Eval('package require BLT; blt::tabnotebook .bltnbook1; pack
.bltnbook1');
$i->MainLoop();
This makes it work, but I do not know why the explicit load command is
necessary. The dynamic loader should be doing that for me.
Many thanks,
--Brian