1

I got the following errors while installind Tk module from perl in MacOS catalina 10.15.6

cpan install Tk

And the error I get


Cannot find '/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/perl.h' have you installed /usr/bin/perl?
Compilation failed in require at Makefile.PL line 37.
BEGIN failed--compilation aborted at Makefile.PL line 39.
Warning: No success on command[/usr/bin/perl Makefile.PL]
  SREZIC/Tk-804.035.tar.gz
  /usr/bin/perl Makefile.PL -- NOT OK
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites

Could you please help me know what's happening here?

4
  • See also this issue. It seems like perl.h is located in an unexpected place. On my mac (10.15.5) I have system perl version 5.18 and perl -MConfig -E'system "ls $Config{archlib}/CORE"' shows only a single file libperl.dylib (usually perl.h is located here). However, perl.h exists in here /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE instead but Tk cannot find it since it is not in the usual place Aug 13 '20 at 21:48
  • To add to the above comment, perl -MConfig -E'say $Config{archlib}' shows /System/Library/Perl/5.18/darwin-thread-multi-2level Aug 13 '20 at 21:54
  • Also the Tk Makefile.PL requires a file myConfig which checks for perl.h in $Config{archlibexp} see line 3. Maybe the easiest solution would be to use perlbrew, then you would get all the headers in the right place ? Aug 13 '20 at 22:20
  • I tried to install Tk with perlbrew perl version 5.30.1, but it seems like it also requires libX11, see this thread for more information Aug 14 '20 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.