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

Hello Monks, This thig is driving me crazy , I have been trying to install Tk module for perl to use it with my perl that I am installing on my PC. I am using active perl the latest for windows . I use cygwin so four steps I have to follow:
perl Makefile.PL make make test make install <code> perl Makefile.PL goes fine , however , when I do make , I get the foll +owing : <code> cpp: installation problem, cannot exec `cc1': No such file or director +y make[1]: *** [ClientWin.o] Error 1 make[1]: Leaving directory `/cygdrive/c/perl/Tk/pTk' make: *** [pTk/libpTk.a] Error 2
I have installed different version of gcc , I have tryied all the ways I could but no luck . Do you think there is somthing wrong in my steps or have someone seen this kinda of error before ? Can someone advice please ?

Replies are listed 'Best First'.
Re: Installing Module
by BrowserUk (Patriarch) on Feb 22, 2004 at 20:48 UTC

    In a nutshell, you cannot use gcc/cygwin to build modules for use with AS builds of perl.

    When you run perl MakeFile.pl it attempts to determine which compiler, linker and other options to use when it builds the Makefile by looking at what was used to build the version of perl that is running MakeFile.PL.

    AS perl is built using MS VC++, and so it sets up the makefile to call that compiler. As the compiler command for that is cl.exe (I'm not sure where the "ccl" in your error message comes from unless it is a transcription error?) but the command to invoke the compiler you are trying to use is gcc.exe, when you attempt to use the generated makefile, the compiler ("cl.exe") cannot be found and the attempt fails.

    You will either need to build perl yourself using gcc, or obtain a copy of the ms compiler.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Timing (and a little luck) are everything!
Re: Installing Module
by Mr. Muskrat (Canon) on Feb 22, 2004 at 20:49 UTC

    First of all, I've never heard of someone using ActiveState's ActivePerl with Cygwin.

    If you prefer to use Cygwin, why not just use the version of Perl that it installs?

    If you would prefer to use ActivePerl and are indeed using the latest version, then why try to install Tk when it is already installed? (ActivePerl includes Tk in the distribution.)

Re: Installing Module
by ysth (Canon) on Feb 22, 2004 at 23:09 UTC
    Looks like you have several problems. First of all, cygwin's gcc seems to be misinstalled. See what cygcheck -cv gcc says. Second, gcc isn't going to work with Activestate's perl, but if the perl that ran Makefile.PL was really Activestate, I don't think it would have tried to run cpp. I'm guessing that perl -V would show you are really running a cygwin perl (though you also have an Activestate perl installed).

    As others have said, Activestate perl comes with Tk. To build Tk for cygwin perl, read the README.cygwin in the Tk distribution. I've heard reports that the native-windows flavor won't build under the newest (5.8.2 w/ithreads) perl; if this proves true, you might try getting an older cygwin perl (5.8.0 w/o ithreads), or build it for XFree86.