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

Tkx not installing properly

by freedee15 (Initiate)
on May 11, 2019 at 19:01 UTC ( #1233609=perlquestion: print w/replies, xml ) Need Help??

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

Hi! I'm relatively new to Perl and have been having some trouble installing Tkx properly. Whenever the maketest is run, I get the error 'failed dlopen(C:/ActiveTcl/bin/tcl86t.dll,...);' (I've made sure ActiveTcl is installed properly and in the right place, and the file in question is where it should be). I've scoured the internet looking for answers to how to fix this, but I haven't been able to find anyone with the same problem. Can anyone help? (full error message below)

Running make test C:\Dwimperl\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_har +ness(0, 'blib\lib', 'blib\arch')" t/*.t t/LabEntry.t ...... failed dlopen(C:/ActiveTcl/bin/tcl86t.dll,...); failed dlopen(C:/ActiveTcl/bin/tcl86t.dll,...); failed dlopen(tcl86t.dll,...); trying dlopen(tcl89t.dll,...) trying dlopen(tcl88t.dll,...) trying dlopen(tcl87t.dll,...) trying dlopen(tcl86t.dll,...) trying dlopen(tcl85t.dll,...) trying dlopen(tcl84t.dll,...) trying dlopen(tcl83t.dll,...) trying dlopen(tcl82t.dll,...) trying dlopen(tcl81t.dll,...) trying dlopen(tcl80t.dll,...) failed all posible tcl vers 8.x from 9 down to 0 at C:/Dwimperl/perl/l +ib/ line 95. Failed to load Tcl dll! at C:/Dwimperl/perl/lib/ line 95. Unable to initialize Tcl at C:/Dwimperl/perl/lib/ line 95. Compilation failed in require at C:\Dwimperl\cpan\build\Tkx-1.09-NoNmn +z\blib\lib/ line 215. BEGIN failed--compilation aborted at C:\Dwimperl\cpan\build\Tkx-1.09-N +oNmnz\blib\lib/ line 215. Compilation failed in require at t/LabEntry.t line 8. BEGIN failed--compilation aborted at t/LabEntry.t line 8.

Replies are listed 'Best First'.
Re: Tkx not installing properly
by syphilis (Archbishop) on May 13, 2019 at 01:25 UTC

    I believe the failure is happening in the XSLoader::dl_load_file() call.
    If C:/ActiveTcl/bin/tcl86t.dll exists, then I'd be thinking it's not a valid dll.
    Perhaps it's a 32-bit dll when a 64-bit dll is required (or vice-versa) ?

    It's also worth reading the comments in relating to dl_load_file failures:
    # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed. my $libref = dl_load_file($file, 0) or do { require Carp; Carp::croak("Can't load '$file' for module $module: " . dl_error()); };
    What's your perl -V output ?


      The available releases of ActiveTcl 8.6 Community Edition for Windows are all 64-bit, while DWIM Perl for Windows is 32-bit. So I think you're right that this issue is due to a bitness mismatch, and a 64-bit Perl distribution (e.g. Strawberry or ActivePerl) would be needed instead.

        BTW I experienced some another problem on Windows 7 with 32bit ActiveTcl, so it took me some effort but then I switched to which then solved all my problems, there are 32 and 64 bit versions, with lots of modules included

        I found this binary while searching in Tclers wiki at, which is also recommended resource for seekers of perl/Tk wisdom :)

        Going to write about this to Jeff Hobbs, who should be aware of such problems in ActiveTCL

        regards, Vadim

Re: Tkx not installing properly
by chrstphrchvz (Scribe) on May 12, 2019 at 06:28 UTC

    I want to quickly point out that this could be an issue between ActiveTcl and (which is where the failed dlopen(…) message comes from), rather than Tkx specifically.

    (I might follow up later if I have more info, because I may have encountered this issue myself recently, but did not investigate it much before trying MagicSplat instead. Edit: My issue was something much different: bad default values in in both ActiveTcl and MagicSplat—not a 32/64-bit mismatch.)

      Really, all I'm looking to do is to be able to use Ttk modules as opposed to Tk modules in Perl. Is there any easier way to do that?

        I'm glad you asked! Yes, there might be.

        You can use Ttk widgets from any Tcl/Tk wrappers: Tkx, Tcl::Tk, Tcl::pTk, and even by itself (disclosure: I now maintain Tcl::pTk and Tkx). However I think which one to use depends on what you're familiar with and whether you're working on an existing Perl/Tk program. I have more info on comparing the wrappers in an answer on StackOverflow. Those familiar with Perl/Tk might try Tcl::Tk and Tcl::pTk: Tcl::Tk is simpler and probably better for new projects not depending on any Perl/Tk extensions, while Tcl::pTk tries to work with existing Perl/Tk programs (they might not work on the first try, but I think the effort of getting them working in Tcl::pTk likely beats rewriting them in Tkx or Tcl syntax). For anyone not familiar with Perl/Tk, or familiar with Tcl/Tk or wrappers on other programming languages (e.g. Tkinter for Python), it might be better to stick with Tkx and follow the tutorials on All of these wrappers allow using pure Tcl syntax as well.

        For existing Perl/Tk programs, you might first give Tcl::pTk::Facelift and Tcl::pTk::TkHijack a try. (I have some notes on using Tcl::pTk::TkHijack in another PerlMonks thread.) If you become "committed" to using Tcl::pTk over Perl/Tk, then another option is prefixing common widget types with ttk (e.g. ttkButton, ttkLabel).

        However, I think there is a strong likelihood that the issue you've encountered here will affect the other Tcl/Tk wrappers. I sent an email to the perl-tcltk mailing list to inform others who might be able to help.

Re: Tkx not installing properly
by vkon (Curate) on May 13, 2019 at 06:59 UTC
    to summarize:
    1. probably this is 32/64 bit not linking together;
    2. but you better switch to BAWT binaries of tcl/tk, which is alternative to ActiveTCL
    3. also Tkx is not recommended, because its syntax too much noisy and requires full rewrite.
    4. suggested by chrstphrchvz Tcl::pTk is probably most easy transition, and probably the best advice in your particular case
    5. another way is to use Tcl::Tk which is small sufficient and gives you perl/Tk syntax, but requires more changes to your already existing perlTk code
Re: Tkx not installing properly
by IB2017 (Pilgrim) on May 13, 2019 at 14:18 UTC
    I work on Windows using latest ActiveTcl (only 64 bit available), Tcl::pTk (to have access to Tk from Perl), and Strawberry Perl (64bit). The combination works fine. Just be sure to have Perl 64 bit installed, then install Tcl::pTk (this will install also which is the linking part between Perl and Tk). The advantage of Tcl::pTk over Tkx is that is actively maintained, as is Tcl/Tk.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1233609]
Approved by haukex
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-01-22 11:26 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (62 votes). Check out past polls.