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

I am using an older ActiveState Perl distribution, 5.8.3 I believe, because it comes with the Perl/Tk module already installed. But now I need to use at least Perl 5.10.0 in order to use a particular module while still needing Perl/Tk. The last time I tried to build the Perl/Tk module with a recent Perl distribution my compilation failed.

What is the easiest way to get Perl/Tk running with a recent Perl distribution, such as 5.12.3? Thanks for any help.

  • Comment on Getting Perl/Tk to run with a recent Perl version

Replies are listed 'Best First'.
Re: Getting Perl/Tk to run with a recent Perl version
by VinsWorldcom (Prior) on Apr 14, 2011 at 18:14 UTC

    I had no issues using:

    • Windows XP
    • Activestate 5.10.0
    • MinGW 3.4.2 (comes with Bloodshed Dev-Cpp)
    • 'ppm install dmake'

    I downloaded the Tk module from CPAN and just did the

    perl Makefile.PL dmake dmake test dmake install

    No issues.

    I've since switched to Strawberry Perl 5.12.2 on Windows XP following the same download and manual build for Tk and had no issues. Note that Strawberry was using its own gcc compiler (I believe version 4.4.3).

    UPDATE: I tried this on Windows 7 x64 (Strawberry Perl 5.12.3) and got some serious errors at the 'dmake' step. I found this link:

    http://www.nntp.perl.org/group/perl.win32.vanilla/2010/07/msg252.html

    Which basically gives this advice. Go to the downloaded working CPAN directory of Tk and 'cd pTk\mTk\xlib\X11' and edit the file 'X.h'.

    Starting at 43: 43: #ifdef _DWIN64 44: typedef __int64 XID; 45: #else 46: typedef unsigned long XID; 47: #endif I was able to correct this by changing this to 43: #ifdef _DWIN64 44: #include <inttypes.h> 45: typedef __int64 XID; 46: #else 47: typedef unsigned long XID; 48: #endif

    Change back to the working CPAN directory of Tk (cd ..\..\..\..) and run 'dmake'. It should work now. You can follow with 'dmake test' and 'dmake install'.

      I have modified the X.h then I have changed back with cd ..\..\..\.. but I do not know what it means to run 'dmake'. When I type dmake in cmd prompt I've got the message "'dmake' is not recognized as an internal or external command,"

        I have modified the X.h then I have changed back with cd ..\..\..\.. but I do not know what it means to run 'dmake'. When I type dmake in cmd prompt I've got the message "'dmake' is not recognized as an internal or external command,"

        Why did you do that?

Re: Getting Perl/Tk to run with a recent Perl version
by lamprecht (Friar) on Apr 14, 2011 at 17:45 UTC
Re: Getting Perl/Tk to run with a recent Perl version
by stefbv (Priest) on Apr 15, 2011 at 07:26 UTC

    Another way is to use ppmx packages:

    For ActivePerl 5.12:

    ppm install http://ppm4.activestate.com/MSWin32-x86/5.12/1200/S/SR/SRE +ZIC/Tk-804.029.ppmx

    For ActivePerl 5.10:

    ppm install http://ppm4.activestate.com/MSWin32-x86/5.10/1000/S/SR/SRE +ZIC/Tk-804.029.ppmx

    Regards, Stefan

        Yes, of course :)

        I like the ppmx packages because it's easy to carry them around with me.

Re: Getting Perl/Tk to run with a recent Perl version
by Argel (Prior) on Apr 14, 2011 at 22:39 UTC
    Not Windows, but I have it running with a self-compiled Perl 5.10.1 (assuming you are talking about Tk and not Tkx) on Solaris 10 SPARC.

    Elda Taluta; Sarks Sark; Ark Arks