Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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/XSLoader.pm line 95. Failed to load Tcl dll! at C:/Dwimperl/perl/lib/XSLoader.pm line 95. Unable to initialize Tcl at C:/Dwimperl/perl/lib/XSLoader.pm line 95. Compilation failed in require at C:\Dwimperl\cpan\build\Tkx-1.09-NoNmn +z\blib\lib/Tkx.pm line 215. BEGIN failed--compilation aborted at C:\Dwimperl\cpan\build\Tkx-1.09-N +oNmnz\blib\lib/Tkx.pm 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 (Bishop) on May 13, 2019 at 01:25 UTC
    Hi,

    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 XSLoader.pm 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 DynaLoader.pm. # 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 ?

    Cheers,
    Rob

      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.

        correct
        BTW I experienced some another problem on Windows 7 with 32bit ActiveTcl, so it took me some effort but then I switched to http://www.bawt.tcl3d.org/download.html#tclbi 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 http://wiki.tcl-lang.org/page/BAWT, 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 (Beadle) on May 12, 2019 at 06:28 UTC

    I want to quickly point out that this could be an issue between ActiveTcl and Tcl.pm (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.)

      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 Tcl.pm by itself. 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 (disclaimer: I maintain this): Tcl::Tk is simpler and probably better for new projects not depending on any Perl/Tk extensions, while Tcl::pTk tries 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 TkDocs.com. 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 (Monk) 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 Tcl.pm 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2019-05-25 04:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (151 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!