Tk Source Code

View Ticket
Login
Ticket UUID: fec832b6bc08e9544ebeaf1e313b72240f64480b
Title: Cross-compiled Tk dll can't find resources
Type: Bug Version: 8.6.8
Submitter: anonymous Created on: 2018-06-17 23:35:08
Subsystem: 85. Win Build Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Pending Last Modified: 2026-09-27 18:57:27
Resolution: None Closed By: nobody
    Closed on:
Description:
On 64-bit Linux with mingw cross-compile tools installed, I cross-compile Tk 8.6.8:

In the win subdir:

$ ./configure --with-encoding=utf-8 --host=x86_64-w64-mingw32 --enable-threads --enable-64bit --with-tcl=/opt/tcl8.6.8/win
$ make tk86.dll

On my Windows 10 computer, I download the binary Tcl/Tk distribution from Thomas Perschak as recommended at https://www.tcl.tk/software/tcltk/bindist.html

I put my new-compiled tk86.dll in place of the downloaded one.

> tclsh86.exe
% package require Tk
% button .b
FindResource() failed for buttons bitmap resource, resources in tk_base.rc must be linked into Tk dll or static executable

The interpreter then crashes.

According to the build commands echoed from the make process, the resources appear to have been included as expected.

I found reports of similar error messages stretching back years, but no solutions.

If this is not a Tk bug, any compilation hints would be appreciated.
User Comments: serhiy.storchaka added on 2026-09-27 18:57:27:

Not reproducible with 8.6.18 on Windows 11: cross-compiled with MinGW-w64 on Linux (with its own tclsh, and with tk86.dll loaded into an MSVC-built tclsh86t), built natively with MinGW, and built with nmake as shared and as static. For static builds wish.rc includes tk_base.rc. If this still happens with a current version, please give the exact build commands.


Jintao added on 2021-09-16 02:06:48:
I solved this issue by using the makefile.vc and rules.vc from tk8.6.7

fvogel added on 2018-06-20 19:19:36:
If your setup worked in 8.6.7 and no longer in 8.6.8, perhaps TIP #477 went in the way? Just a wild guess.

anonymous added on 2018-06-19 21:19:31:
The problem doesn't occur in Tk 8.6.7

anonymous added on 2018-06-18 21:46:36:
I used a resource editor on Windows to verify that the dll contains all expected resource files.