http://www.perlmonks.org?node_id=754255

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

Hello All, I am attempting to install the Tk extension package for perl on my computer at work. I have strawberry perl vs. 5.10 installed on a Windows XP machine. I have used the perl -MCPAN-e shell interface a couple of times to install various modules successfully in the past. When I run: get Tk, everything seems to go fine. However, when I next run:
make Tk
I get the following failure:
... cp tclWinInt.h ..\blib\arch\Tk\pTk\tclWinInt.h cp tixImgXpm.h ..\blib\arch\Tk\pTk\tixImgXpm.h cp tixImgXpm.m ..\blib\arch\Tk\pTk\tixImgXpm.m cp tkCanvases.h ..\blib\arch\Tk\pTk\tkCanvases.h cp tkOption_f.h ..\blib\arch\Tk\pTk\tkOption_f.h cp tixInt.t ..\blib\arch\Tk\pTk\tixInt.t cp tkSelect.h ..\blib\arch\Tk\pTk\tkSelect.h cp tixInt.m ..\blib\arch\Tk\pTk\tixInt.m cp tix.t ..\blib\arch\Tk\pTk\tix.t cp tkPlatDecls_f.h ..\blib\arch\Tk\pTk\tkPlatDecls_f.h cp tkDecls.t ..\blib\arch\Tk\pTk\tkDecls.t cp tkImgPhoto.m ..\blib\arch\Tk\pTk\tkImgPhoto.m cp tixWinPort.h ..\blib\arch\Tk\pTk\tixWinPort.h cp tkColor.h ..\blib\arch\Tk\pTk\tkColor.h cp Xlib.t ..\blib\arch\Tk\pTk\Xlib.t cp tkIntPlatDecls.t ..\blib\arch\Tk\pTk\tkIntPlatDecls.t cp tkWinDefault.h ..\blib\arch\Tk\pTk\tkWinDefault.h cp tkWinPort.h ..\blib\arch\Tk\pTk\tkWinPort.h gcc -c -I.. -I../pTk/mTk/xlib -I. -Ibitmaps -I../pTk/mTk/xlib -s -O2 + -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SY +S -fno-strict-aliasing -DPERL_MSVCRT_READFIX -DPERLDLL -s -O2 -DVERSION=\"804.028\" -DXS_VERSION=\"804.028\" "-IC +:\strawberry\perl\lib\CORE" -Wall -Wno-implicit-int -Wno-comment -W +no-unused -D__USE_FIXED_PROTOTYPES__ ClientWin.c In file included from ..\pTk\mTk\xlib\../../../pTk/Lang.h:23, from ..\pTk\mTk\xlib\../../../pTk/tkIntXlibDecls.h:26 +, from ..\pTk\mTk\xlib\X11/Xlib.h:1206, from ClientWin.c:30: ..\pTk\mTk\xlib\../../../pTk/tcl.h:157: stdio.h: No such file or direc +tory In file included from ..\pTk\mTk\xlib\../../../pTk/tcl.h:2376, from ..\pTk\mTk\xlib\../../../pTk/Lang.h:23, from ..\pTk\mTk\xlib\../../../pTk/tkIntXlibDecls.h:26 +, from ..\pTk\mTk\xlib\X11/Xlib.h:1206, from ClientWin.c:30: ..\pTk\mTk\xlib\../../../pTk/tclPlatDecls.h:21: tchar.h: No such file +or directory dmake: Error code 129, while making 'ClientWin.o' dmake.EXE: Error code 255, while making 'pTk\libpTk.a' SREZIC/Tk-804.028.tar.gz C:\strawberry\c\bin\dmake.EXE -- NOT OK Failed during this command: SREZIC/Tk-804.028.tar.gz : make NO
I figured I could go digging through the paths mentioned when the make command failed but instead I thought I would ask here first to see if anyone has any ideas. If it helps, when I look in my C:\strawberry\cpan\build directory I find a directory and a .yml file named Tk-804.028-5TdOSy However, there is no Tk anything in my actual perl or c lib folders. Any ideas or help would be appreciated. Thanks in advance.

Replies are listed 'Best First'.
Re: Tk Package Fails to Make
by Anonymous Monk on Mar 31, 2009 at 06:57 UTC
    I figured I could go digging through the paths mentioned when the make command failed but instead I thought I would ask here first to see if anyone has any ideas
    Do the obvious first, blog about your problem, don't check any paths :)
      /shrug

      I tend to break things when I start jacking around with the contents of files I know nothing about. Since this is a work computer I figured I would behave and play the role of the wide-eyed user afraid to perturb anything....

      Any ideas on why it doesn't make though? I did poke through some of the paths and couldn't find the tchar.h file anywhere, which is probably the problem. Do I need this file? Any idea where I could get it?
        Yes you need tchar.h/stdio.h... but you should already have them, they come with strawberryperl
        12K C:\strawberry/c/include/tchar.h 20K C:\strawberry/c/include/stdio.h
Re: Tk Package Fails to Make
by BJ_Covert_Action (Beadle) on Apr 06, 2009 at 22:05 UTC
    Alright, I've been doing some sleuthing and here is what I deduced so far. When I run make Tk, a file regarding the TK make process gets created in my c:\strawberry\cpan\build directory. After digging through this newly created directory, I found about 6 files that use an #include tchar.h command if CYGWIN is not defined (which makes sense for me because I am not using Cygwin). I haven't bothered scouring for an #include stdio.h file but I am guessing its probably a similar case.

    Anyways, during the make process, I am hanging on this command:

    gcc -c -I.. -I../pTk/mTk/xlib -I. -Ibitmaps -I../pTk/mTk/xlib -s -O2 + -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SY +S -fno-strict-aliasing -DPERL_MSVCRT_READFIX -DPERLDLL -s -O2 -DVERSION=\"804.028\" -DXS_VERSION=\"804.028\" "-IC +:\strawberry\perl\lib\CORE" -Wall -Wno-implicit-int -Wno-comment -W +no-unused -D__USE_FIXED_PROTOTYPES__ ClientWin.c

    Doing some digging shows that this is a call to the gnu c compiler (though I didn't figure out what all the switches are). When called, this command throws this error

    In file included from ..\pTk\mTk\xlib\../../../pTk/Lang.h:23, from ..\pTk\mTk\xlib\../../../pTk/tkIntXlibDecls.h:26 +, from ..\pTk\mTk\xlib\X11/Xlib.h:1206, from ClientWin.c:30: ..\pTk\mTk\xlib\../../../pTk/tcl.h:157: stdio.h: No such file or direc +tory In file included from ..\pTk\mTk\xlib\../../../pTk/tcl.h:2376, from ..\pTk\mTk\xlib\../../../pTk/Lang.h:23, from ..\pTk\mTk\xlib\../../../pTk/tkIntXlibDecls.h:26 +, from ..\pTk\mTk\xlib\X11/Xlib.h:1206, from ClientWin.c:30: ..\pTk\mTk\xlib\../../../pTk/tclPlatDecls.h:21: tchar.h: No such file +or directory dmake: Error code 129, while making 'ClientWin.o' dmake.EXE: Error code 255, while making 'pTk\libpTk.a' SREZIC/Tk-804.028.tar.gz C:\strawberry\c\bin\dmake.EXE -- NOT OK Failed during this command: SREZIC/Tk-804.028.tar.gz : make NO

    ..which seems to show various infiles getting included, but tchar.h and stdio.h not loading correctly for some reason. This seems strange to me because I do, indeed, have both tchar.h and stdio.h in the following directory:

    c:\strawberry\include\

    so the only conclusions I can come to are:

    1) there is something wrong with my c compiler (which may very well be an issue because I never explicitly downloaded a c compiler, though I have installed CPAN modules before which makes me think that I do, indeed, have the Gnu c compiler functioning).

    2) those two files tchar.h and stdio.h, are somehow corrupt.

    3) there is a command somewhere looking for those two files at one particular path that is different from the path in which they reside.

    4) I have completely misunderstood there errors being thrown at me and need to look for a different problem.

    So, is there anyone else out there willing to help me try to figure out how to get Tk installed and running correctly?

    Thanks to everyone so far for their help. I feel I am getting close.

    Cheers.

      Your installation of StrawberrryPerl is bolloxed. If you reinstall StrawberrryPerl, you should be able to install Tk without problems (I did it one minute ago). Tk is also available via PPM from many repositories, so you can install it via ppm as well.
      I do, indeed, have both tchar.h and stdio.h in the following directory:
      c:\strawberry\include\


      They would normally be in c:\strawberry\c\include.
      Are they *really* in c:\strawberry\include\ ?
      What does gcc -v output ?

      It really does look like your installation has been screwed up, as already suggested.

      Cheers,
      Rob
        *facepalm*

        They are, indeed, in C:\strawberry\c\include, not the original one I posted.

        So is my strawberry distribution still screwed or just my ability to successfully copy paths?

        Thanks.

        Where would I run the gcc - v command, from the CPAN shell or just the straight command line? Running from command line gives only:

        Reading specs from C:\GNAT\lib\gcc-lib\pentium-mingw32msv\2.8.1\specs gcc version 2.8.1

        ...which I suppose is the correct info about my gcc version, unless CPAN does something really strange.

        Also, what makes you say my strawberry installation is bolloxed? I have little doubt that this is true, but I am curious as to what I could look for in the future to figure this out myself.

        Cheers.

Re: Tk Package Fails to Make - Next Crisis
by BJ_Covert_Action (Beadle) on Apr 08, 2009 at 22:56 UTC
    Well, I uninstalled my strawberry distribution so that I could reinstall and get a proper configuration. (I have been thinking about doing this anyways since the first time I installed it I had little idea on what I was doing....)

    Anyways, I went with the 5.10.0.4 distribution this time. I ran the installer and all went well (defaults accepted across the board). I then went into the CPAN shell to update and update my CPAN module. This is where my new nightmare begins. The last chunk of results on an attempted:

    install Bundle::CPAN

    ...dealt me this blow:

    Apparently there is something wrong with my new version of the Compress module. Any I am not sure what is wrong here, I do have Compress and Archive installed in:

    C:\strawberry\perl\lib

    ..already so maybe I don't need them? (I doubt it but why not ask right?) Anyways, I look forward to your posts.

    Cheers.

      Apparently there is something wrong with my new version of the Compress module

      What happens if, in the cpan shell, you run:
      install Math::FFT
      For me, that runs flawlessly, and I think I have the same build of Strawberry as you - according to perl -V my Strawberry Perl was "Compiled at Oct 19 2008 15:47:04" (near the end of the output). Do you have the same ?

      Note that I usually download and build modules manually - I rarely use CPAN.pm, don't know much about its workings, and have no interest in troubleshooting it on Strawberry or anywhere else - but I am prepared to try and assist with matters relating to the general configuration and workability of Strawberry Perl. Normally, however, "the general configuration and workability of Strawberry Perl" is taken care of automatically when Strawberry Perl is installed (so it's rather unusual that any assistance with this is ever required).

      Cheers,
      Rob
        Hmmmm, there's definitely something wrong here.
        perl -v</code) outputs: <p><p> <code> This is perl, v5.10.0 built for MSWin32-x86-multi-thread Copyright 1987-2007, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.

        ...with no discussion of compilation. Attempting  install Match::FFT yields:

        By the way, much thanks for helping me with all of this so far. I'm learning a lot.