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

Hi monks! I'm a Newbie and need to compile Tk under WindowsXP. I just finished compiling the perl source and it works fine. When I try to: perl Makefile.PL in Tk-Directory, I always get the following message: "Note (probably harmless): No library found for -lcomdlg32" and so on. All in all about 20 messages of this kind. If I try 'dmake' or 'dmake install' after this it quits with errors. I'm not sure whats the problem... Can anyone help me? Greez, Giase

Replies are listed 'Best First'.
Re: Compiling Tk under Windows
by PodMaster (Abbot) on Jun 29, 2005 at 08:17 UTC
    I'm not sure whats the problem... Can anyone help me? Greez, Giase
    For whatever reason, perl (and your compiler) can't find those libraries (probably harmless should read probably harmfull). You probably forgot to setup up your enviroment properly (call vcvars32.bat). Compare %lib%, %include%, and %path% before and after (calling vcvars32), you'll notice the difference.

    Read Tutorials => A Practical Guide to Compiling C based Modules under ActiveState using Microsoft C++

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      I tried to call vcvars32.bat, but had the same problem. I have to give additional information to you i think: I compiled perl with 'mingw' and 'dmake', because i want to use a module (Tk::WinPrint) which only compiles with the mingw environment. (The coder of the module told me). The libs are installed on my system in the MS Visual Studio 6 -path. But if i hadn't installed MSVC6 I won't have them. Shouldn't this libs come with mingw, too??? I tried to copy them to the windows/system32-directory but the problem was still there...
        vcvars32, like the tutorial explains, comes with the microsoft compiler. Regardless of what compiler you use, if perl is looking for some .lib, your compiler is also, and it has to be able to find it, which is generally does by examining the INCLUDE/LIB enviroment variables (which is what vcvars32 sets).

        Shouldn't this libs come with mingw, too???
        I don't know, but if the perl you compiled with MinGW is looking for them now, that means that you should already have them, otherwise you could not have compiled perl as you claim to have done.
        I tried to copy them to the windows/system32-directory but the problem was still there...
        Thats probably because windows/system32 is not in your %LIB%, just like that directory you copied them from.

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

        Someone managed to compile Tk::WinPrint on Windows: see: Cpan Testers.

        I suggest that you contact the tester ('barbie(at)missbarbell.co.uk') and ask her how she did it and whether perhaps she still has the compiled version. I would be surprised if a mingw environment was specially set-up for this module (but of course you never know until you ask).

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: Compiling Tk under Windows
by Courage (Parson) on Jun 29, 2005 at 07:46 UTC
    you're probably missing those libs, indeed.

    Need more details to advice further.
    But, as you said, you're newbie, why re-compiling stuff, then, and not just use precompiled binaries?

    Also, Tk is large and compiling it could be difficult. Try compiling Tcl and then install Tcl::Tk, those two CPAN modules could be used instead of Tk with very similar functionality.
    You'll gain much more flexibility with less efforts spent...

      Isn't there a Perl/Tk package with ppm?
Re: Compiling Tk under Windows
by anonymized user 468275 (Curate) on Jun 29, 2005 at 07:47 UTC
    The advantage of Linux is that it maintains track of its dependencies, especially important for shared libraries. On windows, DLLs (dynamic link libraries) fill in the gaps like a big ball of mud. First search for other DLLs to see where they are normally kept on your system (varies for different Windows) - check the code to see where it expects to find them and extend the list of search paths if necessary. Sometimes DLLs are spread around in the wrong places and have to be collected together in (for example) the Windows\System32 directory. Failing that, for those that are really missing, you may have to hunt the internet for those you don't have installed.

    One world, one people

Re: Compiling Tk under Windows
by giase (Novice) on Jun 29, 2005 at 09:41 UTC
    I tried to call vcvars32.bat, but had the same problem. I have to give additional information to you i think: I compiled perl with 'mingw' and 'dmake', because i want to use a module (Tk::WinPrint) which only compiles with the mingw environment. (The coder of the module told me). The libs are installed on my system in the MS Visual Studio 6 -path. But if i hadn't installed MSVC6 I won't have them. Shouldn't this libs come with mingw, too??? I tried to copy them to the windows/system32-directory but the problem was still there...
      so dmake still doesn't even know to look in system32 - doesn't it have a dmake.ini file where you can tell it where to look for the dlls?

      One world, one people

        So you mean perl doesn't find this libraries because dmake doesn't find them? I have no dmake.ini or something... Where can I tell dmake to search for libraries? Best, Giase
Re: Compiling Tk under Windows
by spurperl (Priest) on Jun 29, 2005 at 14:56 UTC
    I might be missing something here, but *why* do you have to compile Tk under WindowsXP ?

    The ActivePerl distribution by ActiveState is free, stable and up-to-date. It comes with a pre-compiled and very well working Tk, right there for you to use. A simple install, no compilation.

Re: Compiling Tk under Windows
by anonymized user 468275 (Curate) on Jun 29, 2005 at 12:37 UTC
    If it's perl that can't find the libs, rather than dmake, try assigning the environment variable PERL5LIB to a list of paths for it to search for DLLs - each path separated by ':'

    One world, one people

      The environtment variable PERL5LIB doesn't exist, so I created it. But there is still the old problem... Where else can i tell perl to search for dlls? p.s.: Guess you meant ';' for path-separation?!
        oops yes - sry I mean semicolons - lol u can see I am a mainly a unix programmer

        One world, one people

        unfortunately that advice was wrong, search elsewhere: you need to tune up your C compiler and/or make
      PERL5LIB does not related to problem in question, C compiler tries to find C libraries, not Perl ones...
Re: Compiling Tk under Windows
by giase (Novice) on Jun 29, 2005 at 13:04 UTC
    How can I tell perl where to search for Libs?
      Not to spoil your fun, but the Activestate Perl distribution is precompiled and runs just fine. Precompiled Perl, TK, and a good portion of CPAN. If you're compiling because you like to, then continue having fun. But if you're compiling Perl and TK because you come from Unix and think that's the best way to go, I suggest having a look at http://activestate.com/Products/ActivePerl/?mp=1

      Cheers

Re: Compiling Tk under Windows
by giase (Novice) on Jun 30, 2005 at 05:22 UTC
    As i mentioned above, I need a Module for Windows (Tk::WinPrint) which doesn't compile with ActiveState or other precompiled binaries for windows. The whole sh.. just because of this little Module I need... Or does someone know how to print the MainWindow under Windows?? (WinPhoto doesn't work for Windows) Greetz, Giase