in reply to macOS tcl::pTk packing Tcl

Are you saying PERL_TCL_DL_PATH is disregarded?

Replies are listed 'Best First'.
Re^2: macOS tcl::pTk packing Tcl
by IB2017 (Pilgrim) on May 29, 2018 at 17:40 UTC

    No, I am saying that I am not able to make it work, actually I do not know if it is disregared or not (maybe it is just me that is unable to put the right path). To be more explicitly, what do I have to set in the next BEGIN for $frameworkpath if I want to use, let's say, the default Tcl which the program above says is - as far as Tk is concerned - in /System/Library/Frameworks/Tk.Framework/Versions/8.5/Resources (I want to 'override' the environment path now, as an exercise, but for true I want to link it to a Tcl installation which is in another path.)

    BEGIN { my $frameworkpath = ""; print $ENV{'PERL_TCL_DL_PATH'} = $frameworkpath; }

    Something like this does not work: my $frameworkpath = "/Library/Frameworks/Tcl.Framework/Versions/8.5/Resources/"; (I just installed ActiveTcl, this gets linked to my script, but I want to resort to the default Tcl installed in my Mac)

      Why don't you know? Don't you get a warning when it fails to load the dll you specify?

      Also did you just switch what you wanted? That (I just installed ActiveTcl, this gets linked to my script, but I want to resort to the default Tcl installed in my Mac)

        Thank you Anonymous Monk, but I do not know what I expressed wrong in my post. I do NOT know what to specify. On macOS there are not dll, by the way. I am trying just by trial and error to put some path in frameworkpath, but as I am moving blindly (I really do not find any info on the Web), it does not work and always fires something like

        Frameworks/Tcl.Frameworkdlopen(Frameworks/Tcl.Framework, 10): no suita +ble image found. Did find: Frameworks/Tcl.Framework: not a file

        I am also experimenting with Tclkit (for example from http://kitcreator.rkeene.org/fossil/index (it should be a single file, maybe easier for portability), but in lack of clear instructions, I fail.

        I do not understand your second question. macOS comes with a preinstalled version of Tcl (8.5). I installed a second version (ActiveTcl 8.6) in order to experiment with switching between different versions and not let the modules Tcl/Tcl::pTk choose one without my control. As you can see, I am a bit confused about the whole

        .

        UPDATE

        With the following BEGIN statement

        BEGIN { my $frameworkpath = "Frameworks/Tcl.Framework/Versions/8.5/Tcl"; print $ENV{'PERL_TCL_DL_PATH'} = $frameworkpath; }

        I've been able to link my script to a specific Tcl installation (in my case the pre-installed Tcl on my Mac). Without the BEGIN it is linked to the ActiveTcl I installed. Note the I specify no dll, but the Tcl executable. I start to see some light at the end of the tunnel...

        UPDATE 2

        The above BEGIN code works only partially, as the Tk library used is always the same one... also, no step forward and almost ready to give up