Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Problem installing TK module

by dgriff792 (Initiate)
on Mar 31, 2015 at 21:33 UTC ( [id://1122064]=perlquestion: print w/replies, xml ) Need Help??

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

I have Strawberry Perl installed and trying to run dmake and getting many errors. This is the latest error. collect2.exe: error: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Tk\Tk.xs.dll' Can someone tell me how to fix this? Thanks!

Replies are listed 'Best First'.
Re: Problem installing TK module
by VinsWorldcom (Prior) on Mar 31, 2015 at 23:33 UTC

    I've had issues installing Tk on Strawberry too, but always get it to work. Currently Windows 7 x64 w/ Strawberry 5.18 64-bit:

    VinsWorldcom@C:\Users\VinsWorldcom> ver Microsoft Windows [Version 6.1.7601] VinsWorldcom@C:\Users\VinsWorldcom> perl -v This is perl 5, version 18, subversion 1 (v5.18.1) built for MSWin32-x +64-multi-thread [...] VinsWorldcom@C:\Users\VinsWorldcom> perl -MTk -e "print $Tk::VERSION" 804.031

    IIRC, it was a 64-bit thing. Anyway, here's the fix I use:

    http://perlmonks.org/?node_id=899504
    http://www.nntp.perl.org/group/perl.win32.vanilla/2010/07/msg252.html

    Go to the downloaded working CPAN directory of Tk

    cd pTk\mTk\xlib\X11

    Edit the file 'X.h'.

    Starting at line 43:

    43: #ifdef _DWIN64 44: typedef __int64 XID; 45: #else 46: typedef unsigned long XID; 47: #endif

    Change to:

    43: #ifdef _DWIN64 44: #include <inttypes.h> 45: typedef __int64 XID; 46: #else 47: typedef unsigned long XID; 48: #endif

    Go back to root of the build directory and:

    dmake dmake test dmake install
Re: Problem installing TK module
by dgriff792 (Initiate) on Mar 31, 2015 at 21:41 UTC
    PS E:\Tk-804.033.tar\Tk-804.033\Tk-804.033> dmake cd pTk && dmake DEFINE="" dmake.exe: Warning: -- Target [pTk\libpTk.a] was made but the time st +amp has not been updated. dlltool --def Tk.def --output-exp dll.exp g++ -o blib\arch\auto\Tk\Tk.xs.dll -Wl,--base-file -Wl,dll.base -mdll +-s -L"E:\perl\lib\CORE" -L"E:\c\lib" Tk.o chnGlue.o encGlue.o evtGlue.o objGlue.o tixGlu +e.o tkGlue.o tkGlue_f.o tkWin32D ll.o pTk\tkres.o pTk/libpTk.a "E:\perl\lib\CORE\libperl520.a" -lmo +ldname -lkernel32 -luser32 -lgdi32 -lwinspool -lco mdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2 +_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -l comctl32 dll.exp pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0xc78): undefined reference to +`ImmGetContext' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0xc9d): undefined reference to +`ImmSetCompositionWindow' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0xca8): undefined reference to +`ImmReleaseContext' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0x1744): undefined reference to + `ImmGetContext' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0x176e): undefined reference to + `ImmGetCompositionStringA' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0x17bb): undefined reference to + `ImmGetCompositionStringW' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0x18d1): undefined reference to + `ImmReleaseContext' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0x18e1): undefined reference to + `ImmGetCompositionStringW' pTk/libpTk.a(tkWinX.o):tkWinX.c:(.text+0x18f1): undefined reference to + `ImmGetCompositionStringA' E:/c/bin/../lib/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mi +ngw32/bin/ld.exe: pTk/libpTk.a(tkWinX.o): bad relo c address 0x28 in section `.data' E:/c/bin/../lib/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mi +ngw32/bin/ld.exe: final link failed: Invalid opera tion collect2.exe: error: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Tk\Tk.xs.dll'
      undefined reference to `Imm ...

      You need to link to libimm32.a (which should ship with strawberry).
      I don't know why this is isn't happening automatically for you. (It happened automatically for me.)

      UPDATE: I think I identified the wrong Makefile in what follows. It's the top level Makefile (not the the pTk/Makefile) that's failing to provide the libimm32.a link.

      If you go into your Tk build directory, and open up the pTk/Makefile, you should find EXTRALIBS and LDLOADLIBS entries about a third of the way down - and those entries should specify the full path to (among other libs) libimm32.a.
      If that lib is missing, just insert it at the beginning.
      For example, my EXTRALIBS and LDLOADLIBS begin with:
      "C:\_64\strawberry5.20.0\c\x86_64-w64-mingw32\lib\libimm32.a"

      If you fix those entries, you should then be able to 'cd' into the 'Tk' build directory and run 'dmake test' followed by 'dmake install' ... and that will hopefully work.

      However, the fact that this didn't all happen correctly in the first place might indicate that there's something more serious. See how it goes.

      Cheers,
      Rob
        That worked! Thanks Rob. I appreciate your help.
Re: Problem installing TK module (strawberryperl version)
by Anonymous Monk on Mar 31, 2015 at 22:20 UTC
    Which version of strawberryperl?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1122064]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-23 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found