• Loading a .tcl file results in 'Bad exe format.' message

    From Helmut Giese@21:1/5 to All on Mon Jun 6 21:17:54 2022
    Hello out there,
    for a while I have been receiving error messages like the above. I was
    able to reduce the scenario to a tiny package which lead to this
    result:
    tclsh
    % package require XYZ
    couldn't load library
    "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
    Possibly a 32/64-bit mismatch.
    %
    I blieve this error merits a ticket - however I have completetly
    forgotten where and how this is done.
    If someone could refresh my memory this would be helpful. Thanks
    Helmut

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Siri Cruise@21:1/5 to Christian Gollwitzer on Mon Jun 6 13:48:37 2022
    In article <t7lof1$oqq$[email protected]>,
    Christian Gollwitzer <[email protected]> wrote:

    "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format. Possibly a 32/64-bit mismatch.
    %

    Are you sure that it says "xyz.tcl" and not "xyz.dll"? If the former, it
    is an error in the package - if you try to do "load xyz.tcl" this must
    fail. If, however, it does "load xyz.dll", then the most likely reason
    is the one given in the message - you are running a 32 bit tclsh and try
    to load a 64 bit extension or vice versa. There are other possibilities,
    but they are less likely (like trying to load a Linux package under
    Windows etc.)

    It's unlikely a unix path would begin with 'D:'.

    --
    :-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
    'I desire mercy, not sacrifice.' /|\ Discordia: not just a religion but also a parody. This post / \
    I am an Andrea Chen sockpuppet. insults Islam. Mohammed

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Mon Jun 6 22:35:44 2022
    Am 06.06.22 um 21:17 schrieb Helmut Giese:
    Hello out there,
    for a while I have been receiving error messages like the above. I was
    able to reduce the scenario to a tiny package which lead to this
    result:
    tclsh
    % package require XYZ
    couldn't load library
    "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
    Possibly a 32/64-bit mismatch.
    %

    Are you sure that it says "xyz.tcl" and not "xyz.dll"? If the former, it
    is an error in the package - if you try to do "load xyz.tcl" this must
    fail. If, however, it does "load xyz.dll", then the most likely reason
    is the one given in the message - you are running a 32 bit tclsh and try
    to load a 64 bit extension or vice versa. There are other possibilities,
    but they are less likely (like trying to load a Linux package under
    Windows etc.)

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to [email protected] on Mon Jun 6 16:43:05 2022
    What is package XYZ? Is there a .dll file associated with it? Was that dll file compiled for 64 bit or 32 bit? I presume the tclsh executable is 64 bit. If the dll for package XYZ was compiled for 32-bit, this is a legit error message. I would look in xyz.tcl -- does it contain a line like:

    load [file join $dir xyz[info sharedlibextension]]

    ???

    MS-Windows considers dlls as "exe" files, so a baddly formed dll (such as one for the arch.) will result in a "Bad exe format" error message (even though that might seem strange and misleading
    ).

    At Mon, 06 Jun 2022 21:17:54 +0200 Helmut Giese <[email protected]> wrote:


    Hello out there,
    for a while I have been receiving error messages like the above. I was
    able to reduce the scenario to a tiny package which lead to this
    result:
    tclsh
    % package require XYZ
    couldn't load library
    "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
    Possibly a 32/64-bit mismatch.
    %
    I blieve this error merits a ticket - however I have completetly
    forgotten where and how this is done.
    If someone could refresh my memory this would be helpful. Thanks
    Helmut



    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    [email protected] -- Webhosting Services

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Tue Jun 7 09:47:39 2022
    Am 06.06.22 um 20:17 schrieb Helmut Giese:
    Hello out there,
    for a while I have been receiving error messages like the above. I was
    able to reduce the scenario to a tiny package which lead to this
    result:
    tclsh
    % package require XYZ
    couldn't load library
    "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
    Possibly a 32/64-bit mismatch.

    Re-reading your question it seems to me that you made this "xyz" package yourself - correct? Maybe you are looking for the command "source" which
    runs a Tcl script instead of the command "load" which loads a binary
    extension (C compiled code)? If that is correct, it would have been
    helpful to post the contents of this XYZ package so that we could see
    what you are doing.

    As to your question, the bug tracker for Tcl is on fossil:

    https://core.tcl-lang.org/index.html

    Go to the corresponding project, i.e. Tcl, and then select "Tickets" in
    the nav bar at the top.

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Giese@21:1/5 to All on Tue Jun 7 18:12:07 2022
    Arrgh,
    what a blunder. I was attempting to install a package via "copy 'n
    paste" but evidently didn't pay attention and started from a pkgIndex
    file which 'loaded' a dll - instead of one that 'sourced' a Tcl file.
    Thanks a lot for spotting it - and sorry for the noise.
    Helmut

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)