“macOS_SDK_headers_for_macOS_10.14.pkg is incompatible with this version of macOS” while installing Haskell on OS X mojave

大兔子大兔子 提交于 2020-02-20 10:32:59

问题


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

回答1:


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


来源:https://stackoverflow.com/questions/58897928/macos-sdk-headers-for-macos-10-14-pkg-is-incompatible-with-this-version-of-maco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!