osx-lionxcode4.3

XCode 4.3 - perl can't find C compiler after upgrade from XCode 4.2


I recently upgraded to Lion and to XCode 4.3 and now anything that I do with perl that requires the C compiler is failing to build:

root# perl Makefile.PL 
Couldn't find your C compiler
Compilation failed in require at Makefile.PL line 5.
BEGIN failed--compilation aborted at Makefile.PL line 5.

my c compiler is set to:

root# perl -V:cc
cc='llvm-gcc-4.2';

Is there anything that changed on XCode 4.3?, how do I set the C Compiler for perl now?.


Solution

  • The new version of Xcode doesn't install the binaries (such as the C compiler) where they can be found in your $PATH. You'll need to go to the "Downloads" section of your XCode preferences and elect to install the command line tools.

    More information from Apple (look for "Command line tools are optional").