I am having trouble building the Tkx module with Strawberry Perl on a Windows 10 platform. It is failing on the Tcl dependency. The errors are:
Tcl.o:Tcl.c:(.text+0x65): undefined reference to `__imp_Tcl_GetStringFromObj'
Tcl.o:Tcl.c:(.text+0x15e): undefined reference to `__imp_Tcl_ListObjGetElements'
Tcl.o:Tcl.c:(.text+0x1fb): undefined reference to `__imp_Tcl_GetStringFromObj'
Tcl.o:Tcl.c:(.text+0x29a): undefined reference to `__imp_Tcl_GetByteArrayFromObj'
Tcl.o:Tcl.c:(.text+0x4bf): undefined reference to `__imp_Tcl_NewStringObj'
Tcl.o:Tcl.c:(.text+0x538): undefined reference to `__imp_Tcl_NewDoubleObj'
Tcl.o:Tcl.c:(.text+0x58f): undefined reference to `__imp_Tcl_NewStringObj'
Tcl.o:Tcl.c:(.text+0x5d7): undefined reference to `__imp_Tcl_NewByteArrayObj'
Tcl.o:Tcl.c:(.text+0x621): undefined reference to `__imp_Tcl_NewListObj'
Tcl.o:Tcl.c:(.text+0x643): undefined reference to `__imp_Tcl_ListObjAppendElement'
Tcl.o:Tcl.c:(.text+0x6a1): undefined reference to `__imp_Tcl_NewObj'
Tcl.o:Tcl.c:(.text+0x6af): undefined reference to `__imp_Tcl_ListObjAppendElement'
Tcl.o:Tcl.c:(.text+0x6d1): undefined reference to `__imp_Tcl_NewIntObj'
Tcl.o:Tcl.c:(.text+0x786): undefined reference to `__imp_Tcl_NewByteArrayObj'
Tcl.o:Tcl.c:(.text+0x839): undefined reference to `__imp_Tcl_WrongNumArgs'
and many, many more similar errors. I searched, but I found nothing even close. The Strawberry Perl version is 5.26.4 and I did the recommended
cpan Tkx
I get the same errors when trying to build the Tcl module by itself with:
cpan Tcl
I have ActiveTcl installed, but Strawberry Perl doesn't seem to see it.
How do I get a working Tcl module for Strawberry Perl?
I managed to get the build to work on Strawberry Perl 5.26. (The binutils package bundled with 5.24 seems to have a bug that makes it not recognize the .lib
files from Tcl.)
The issue seems to be
Warning (mostly harmless): No library found for -ltcl86
in the vanilla build, because that library is definitely required. In my C:\ActiveTcl\lib
there is indeed no tcl86.lib
, but there is a tcl86t.lib
.
So ...
cpan
. This drops you in the cpan shell.look Tcl
. This downloads the Tcl module (if necessary) and drops you in the cmd shell in the build directory.Makefile.PL
using your favorite editor.Around line 183 there should be a line saying:
$libpath .= " -ltcl$buildtype$tclver";
Add another line after it:
$libpath .= "t";
Save and exit your editor.
perl Makefile.PL
. It should now be using -ltcl86t
.exit
in the cmd shell to get back to the cpan shell.install Tcl
. This should go through successfully.exit
again to exit the cpan shell.