I am trying to install Tk using cpan I get an error. This is on a PC, Windows 10, Strawberry Perl 5.38.1
Attempting a basic install of the Tk module, everything downloads, makefile runs to a point, but then terminates on error.
I am using this at the command line: cpan Tk
I get this error:
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 '(' before numeric constant 182 | #define ControlMask (1<<2) | ^ gmake[1]: *** [makefile:891: imgBMP.o] Error 1 gmake[1]: Leaving directory 'C:/perl/cpan/build/Tk-804.036-2/pTk' gmake: *** [makefile:1638: pTk/libpTk.a] Error 2 SREZIC/Tk-804.036.tar.gz C:\perl\c\bin\gmake.exe -- NOT OK Stopping: 'install' failed for 'Tk'.
Here is the code section from X.h, with some context (error is on line 182):
177: /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
178: state in various key-, mouse-, and button-related events. */
179:
180: #define ShiftMask (1<<0)
181: #define LockMask (1<<1)
182: #define ControlMask (1<<2)
183: #define Mod1Mask (1<<3)
184: #define Mod2Mask (1<<4)
185: #define Mod3Mask (1<<5)
186: #define Mod4Mask (1<<6)
187: #define Mod5Mask (1<<7)
I'm not sure what the compiler version is; it is whatever installed with Strawberry Perl, since I didn't have gcc/gmake installed previously.
Any suggestions? what do I not see? (btw: I checked - no funky characters hidden in the whitespace) OR - is there a better way to install Tk? It kindof defeats the purpose of cpan if you have to go thru and edit the source.