How to make clang use a different tk framework version on MacOS?

tastyminerals tastyminerals at gmail.com
Mon Sep 20 21:58:27 UTC 2021


My tkd GUI app started getting compiled with an outdated 8.5 Tk 
framework version which gets shipped with command line tools: 
`xcode-select --install`. As a result, the UI doesn't display 
icons and is laggy. When you run the compiled tk app, you get a 
notorious warning:

```
DEPRECATION WARNING: The system version of Tk is deprecated and 
may be removed in a future release. Please don't rely on it. Set 
TK_SILENCE_DEPRECATION=1 to suppress this warning.
```

This didn't happen before but here is why it probably started to 
occur.

I've recently been playing with uninstalling the MacPorts in 
favour of homebrew and in the process I had to remove tk8.6 
library which was installed once by MacPorts. I wasn't aware that 
command line tools come with their own version of tk which is 
8.5. Somehow, after moving to homebrew, I rebuilt the app and saw 
new warnings that never appeared before:
```
../../../../.dub/packages/tkd-1.1.13/tkd/source/tkd/image/png.d(83,7): Deprecation: Function `tkd.image.image.Image.embedBase64Data!("lock.png", EmbeddedPng!"lock.png").embedBase64Data` of type `@system EmbeddedPng!"lock.png"()` is not accessible from module `png`
```

I tried coming back to MacPorts, reinstalling the command line 
tools reinstalling the tkd and dub dependencies but nothing 
worked so far. Maybe someone here has experience how to make 
clang go and link against the tk 8.6 version installed by 
MacPorts instead of 8.5. That would be of great help.



More information about the Digitalmars-d-learn mailing list