in reply to Re: Tk::Canvas not working
in thread Tk::Canvas not working

I tried to follow your advice by first uninstalling the existing Tk::Canvas with the command cpanm --uninstall Tk::Canvas, and then reinstalling it with the command cpan Tk::Canvas. Uninstall was successful. The installation failed with messages ending as follows.

In file included from ../pTk/mTk/xlib/X11/Xlib.h:31, from tkWinPort.h:19, from tkPort.h:32, from tk.h:87, from imgBMP.c:11: ../pTk/mTk/xlib/X11/X.h:182:34: error: expected identifier or '(' befo +re numeric constant 182 | #define ControlMask (1<<2) | ^ gmake[1]: *** [makefile:891: imgBMP.o] Error 1 gmake[1]: Leaving directory 'C:/STRAWB~1/cpan/build/Tk-804.036-2/pTk' gmake: *** [makefile:1638: pTk/libpTk.a] Error 2 SREZIC/Tk-804.036.tar.gz C:\STRAWB~1\c\bin\gmake.exe -- NOT OK Stopping: 'install' failed for 'Tk::Canvas'

This does look familiar. I think that I did have this problem with my original installation of Tk, but do not remember the solution.

UPDATE: Found my old notes. Refer Tk install fails. I had installed Tk with the command cpanm https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/patched_cpan_modules/Tk-804.036_001.tar.gz. Perhaps I should uninstall all of Tk and repeat that command.

Bill

Replies are listed 'Best First'.
Re^3: Tk::Canvas not working
by syphilis (Archbishop) on Dec 06, 2024 at 00:30 UTC
    Perhaps I should uninstall all of Tk and repeat that command

    Yes- that's the next thing to try. (Even if the uninstall fails, just forcing a reinstallation of that Tk distro should suffice.)
    It seems odd to me that "cpanm --install Tk::Canvas" tried to install Tk first. It suggests that your existing Tk installation is also unusable.

    Cheers,
    Rob
      When I tried to uninstall Tk, I received a message that TK was not found. It seems like my attempt to uninstall Tk::Canvas had uninstalled all of Tk. When I tried to reinstall Tk, Norton Anti-Virus found viruses in at least two files, including "Win64.Evo.gen[Trj]" in Canvas.xs.dll, which of course caused the install to fail. I now suspect that this whole chain of events was started by Norton downloading a new virus signature which fit this file. It must have removed or quarantined the file without my noticing it. I strongly believe that this is a false positive, but I have not decided how to proceed.
      Bill
        It seems like my attempt to uninstall Tk::Canvas had uninstalled all of Tk.

        Yes - I see now that Tk::Canvas is part of Tk. (I had assumed it was a separate distribution, but it's not.)

        You firstly need to find out how to deal with this DOS attack that Norton AV has launched. (I don't know how best to do that, but I would expect there is some way of telling the AV program to permit these "infected" files to be installed and executed.)
        Then, re-running:
        cpanm https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/ +download/patched_cpan_modules/Tk-804.036_001.tar.gz
        should be all that's needed.

        Cheers,
        Rob
        Downloading an updated virus signature database might not help, because the name "Win64.Evo.gen{Trj}" indicates that this particular false positive was detected based on heuristic scan, not based on a signature match. So, the anti-virus software disassembles the code and looks for particular code patterns or operations rather than a specific match. For example, I remember, back in the day when everybody used MS-DOS, it was a popular thing for viruses to look for all the EXE or COM files within the current directory. So, anti-virus softwares were designed to look for this behavior rather than a particular code. So, when the anti-virus program noticed that a program searches for *.exe and *.com, then that caused an warning alert. And that's what you have here. It's not a match based alert. So, you will have to go into options and disable the heuristic scanner. I don't have Norton Antivirus, so I can't give you more step-by-step directions on how to do that. But that's what you'll have to do. Or you can just disable the entire virus scanner temporarily while you install the Tk module.