ActivePerl 5.22.1 - Tk 804.033 - Not working

Posted by welleozean on 2016-06-15 08:52

I have a fresh installation of ActivePerl 5.22.1 and Tk 804.033 on OS X ElCapitan. Running a simple Tk testing code I get the following error

Can't load '/Users/xxx/Library/ActivePerl-5.22/lib/auto/Tk/Tk.bundle' for module Tk: dlopen(/Users/xxx/Library/ActivePerl-5.22/lib/auto/Tk/Tk.bundle, 1): Library not loaded: /opt/X11/lib/libX11.6.dylib
  Referenced from: /Users/xxx/Library/ActivePerl-5.22/lib/auto/Tk/Tk.bundle
  Reason: image not found at /usr/local/ActivePerl-5.22/lib/ line 198.
 at line 4.
Compilation failed in require at line 4.

PATH is set correctly. I already tried to reinstall Tk with ppm. Any Idea?

welleozean | Wed, 2016-06-15 09:01

PS: Tk.bundle seems to be in place; line 4 of the script ist use Tk;

ActiveState Staff
Wed, 2016-06-15 10:45

The PPM systems compiled Tk with these settings:
Using -L/usr/X11R6/lib to find /usr/X11R6/lib/libX11.dylib
Using -I/usr/X11R6/include to find /usr/X11R6/include/X11/Xlib.h

On El Capitan, XQuartz will install into /opt/X11 instead of /usr/X11R6, so try adding symbolic links from /opt/X11 to /usr/X11R6.

pvmikev | Thu, 2016-10-13 20:01

I couldn't get Tk 804.033 to install correctly with ActiveState Perl 5.22. So I removed it and am using Tkx instead which
works beautifully on macOS Sierra with ActiveState's Perl 5.22.

However if you absolutely need Tk and can't use Tkx or can't afford the time to re-program legacy Tk scripts, then I recommend the following which I got to work:

It uses Perl 5.22 from MacPorts and the MacPorts 5.22 Tk 804.033 installation.
This combination works fine on macOS Sierra and installs with no errors and you can use all the Tk you want
including legacy Perl/Tk scripts with absolutely no problems. I've got it working perfectly on my MacBook Pro.