phillc has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to create a GUI based application that takes advantage of widget enhancements in Tcl/Tk 8.5

I guess my first question is whether this is possible using the Tcl::Tk module from CPAN? As this is a direct bridge with Tcl/Tk I am assuming it is.

However, I cannot get Tcl:Tk module to install correctly on a system that has only Tk 8.5 and Tcl 8.5 (not Tk 8.4 and Tcl 8.4) installed.

Initially I was unable to run the makefile with:

> perl Makefile.pl

by declaring the path of tclsh I was seemingly able to overcome this:

> perl Makefile.pl --tclsh /usr/bin/tclsh8.5

However, the output does say:

Warning: prerequisite Tcl 0.9 not found.
Writing Makefile for Tcl::Tk

From this point on I was able to make and make install the module. Although there were further warnings about Tcl 0.9 or better not being found.

I am sure that Tcl 8.5 is installed:

> whereis tcl8.5
> tcl8: /usr/lib/tcl8.5 /usr/include/tcl8.5

So why does the module complain?

Anyway, I think the root of all my problems stem from this pre-requisite not being met. Even after compiling and installing the module, when I attempt to execute a script the error is:

Can't locate Tcl.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8
/usr/share/perl/5.8 /usr/local/lib/site_perl .) at
/usr/local/share/perl/5.8.8/Tcl/Tk.pm line 4.
BEGIN failed--compilation aborted at /usr/local/share
/perl/5.8.8/Tcl/Tk.pm line 4.
Compilation failed in require at perltktest.pl line 3.
BEGIN failed--compilation aborted at perltktest.pl line 3.

If I install Tcl 8.4 and Tk 8.4 all works well with the module, but I can't access any 8.5 enhancements. So perhaps, Tcl::Tk doesn't support 8.5 as it stands. Can anyone give me some pointers to updating the module to look for the 8.5 versions of Tcl and Tk?

Many thanks!

Replies are listed 'Best First'.
Re: Using Tcl::Tk Module with Tcl/Tk 8.5
by Anonymous Monk on May 20, 2008 at 13:53 UTC
      OK, thank you. Foolish mistake on my behalf due to not reading carefully enough.

      This does bring me to the next issue though. Installing Tcl-0.95 results in:

      > perl Makefile.PL
      > tclsh=/usr/bin/tclsh
      tcl_library=/usr/share/tcltk/tcl8.5
      tcl_version=8.5
      LIBS = -ltcl8.5
      Use of uninitialized value in concatenation (.) or string at Makefile.PL line 204.
      INC =
      DEFINE =
      Use of uninitialized value in string at Makefile.PL line 220.
      Checking if your kit is complete...
      Looks good
      Writing Makefile for Tcl

      Make then subsequently fails with:

      > make
      > cp Tcl.pm blib/lib/Tcl.pm
      /usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp
      -typemap /usr/share/perl/5.8/ExtUtils/typemap -typemap
      typemap Tcl.xs > Tcl.xsc && mv Tcl.xsc Tcl.c
      Please specify prototyping behavior for Tcl.xs (see perlxs manual)
      cc -c -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
      -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local
      /include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
      -DVERSION=\"0.95\" -DXS_VERSION=\"0.95\" -fPIC
      "-I/usr
      /lib/perl/5.8/CORE" Tcl.c
      Tcl.xs:33:17: error: tcl.h: No such file or directory
      Tcl.xs:127: error: expected ‘)’ before ‘*’ token
      *snip* Lots more similar errors
      make: *** Tcl.o Error 1

        fix incpath