11

While running the following code block,

$ cd /Library/Developer/CommandLineTools/Packages/
$ open macOS_SDK_headers_for_macOS_10.14.pkg

The installer warned

This package is incompatible with this version of macOS and may fail to install.

And when I choose 'Install Anyway', it fails.

How can I possibly get it work?

Some possibly relevant environmental versions:
OS: macOS 10.14.5
xcodebuild -version: Xcode 11.2.1
gcc --version: gcc (Homebrew GCC 9.2.0_1) 9.2.0

Bigger Context: I was setting up haskellstack, following instructions on https://docs.haskellstack.org/en/stable/install_and_upgrade/

while running $ stack setup I came accross

configure: error: in '~/.stack/programs/x86_64-osx/ghc-8.6.5.temp/ghc-8.6.5':
configure: error: C compiler cannot create executables
See 'config.log' for more details
Received ExitFailure 77 when running

and per the Notes section of the instructions, I ran

$ xcode-select --install

and it says

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

And then (following the same instructions) I ran

$ cd /Library/Developer/CommandLineTools/Packages/
$ open macOS_SDK_headers_for_macOS_10.14.pkg
ZChen
  • 111
  • 1
  • 1
  • 5

1 Answers1

28

My MacOS is 10.14.6

I found a solution in another website by MacrossEO, see https://donatstudios.com/MojaveMissingHeaderFiles

I had to removed the command line tools with 'sudo rm -rf /Library/Developer/CommandLineTools'

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
cd /Library/Developer/CommandLineTools/Packages/
open macOS_SDK_headers_for_macOS_10.14.pkg
Octeny
  • 499
  • 5
  • 7
  • Go figure, I also had to rm this folder and reinstall as you indicate - the pkg I had in this location would fail to install... – Philippe Aug 04 '20 at 12:00
  • 2
    I don't see a `/Library/Developer/CommandLineTools/Packages/` after reinstalling `Xcode` and the `packages` should be 'SDKs – Kambiz Jun 03 '22 at 19:09
  • I am running OSX12.4 and apparently, things have changed, [see here](https://developer.apple.com/documentation/xcode-release-notes/xcode-10-release-notes#3035624) – Kambiz Jun 03 '22 at 21:06