in reply to Re^2: Perl Tk on a Mac
in thread Perl Tk on a Mac

Perhaps install Perl via Homebrew, then install Perl Tk with that?

Replies are listed 'Best First'.
Re^4: Perl Tk on a Mac
by 1nickt (Canon) on Mar 20, 2025 at 11:52 UTC

    I have Perl installed with perlbrew and configuration of the Tk package is failing with:

    checking whether the C compiler (cc -fno-common -DPERL_DARWIN -mmacosx-version-min=14.7 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -fno-common -DPERL_DARWIN -mmacosx-version-min=14.7 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -mmacosx-version-min=14.7 -fstack-protector-strong -L/usr/local/lib) works... no configure: error: installation or configuration problem: C compiler cannot create executables. ERROR from evaluation of /Users/ntonkin/.cpanm/work/1742471200.46755/Tk-804.036/JPEG/Makefile.PL: ERROR from evaluation of /Users/nick/.cpanm/work/1742471200.46755/Tk-804.036/JPEG/jpeg/Makefile.PL: Error opening Makefile: No such file or directory at ./Makefile.PL line 41.

    I installed gcc from Homebrew but it did not change the error message.


    The way forward always starts with a minimal test.

      this looks promising: cpanm Tk build errors especially the last comments

      It could well be that, as srini@pm suggests in his solution, a difference in the C standard of a probably included Tk header file in the C testfile it tries to compile.

      but perhaps you could also find what the offending C test program is for which the compiler (with the specific flags) fails.

        Thanks bliako,

        export CFLAGS="-ansi" export LDFLAGS="-ansi" export CPPFLAGS="-ansi"
        worked to get the configure step completed.

        Now the test run is hanging... I'll dig into that. I'm seeing some Tk windows being created in the tests that are running, though...


        The way forward always starts with a minimal test.