hfsevents icon indicating copy to clipboard operation
hfsevents copied to clipboard

fatal error: 'CoreServices/CoreServices.h' file not found OS X Catalina

Open serhiip opened this issue 4 years ago • 6 comments

I am facing an above issue when running cabal install hfsevents. This is very similar to #3

Error message I get:

Resolving dependencies...
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
 - hfsevents-0.1.6 (lib) (requires build)
Starting     hfsevents-0.1.6 (lib)
Building     hfsevents-0.1.6 (lib)

Failed to build hfsevents-0.1.6.
Build log ( /Users/serhiip/.cabal/logs/ghc-8.10.1/hfsvnts-0.1.6-e6f8b654.log
):
Configuring library for hfsevents-0.1.6..
Preprocessing library for hfsevents-0.1.6..
Building library for hfsevents-0.1.6..
[1 of 1] Compiling System.OSX.FSEvents ( System/OSX/FSEvents.hs, dist/build/System/OSX/FSEvents.o, dist/build/System/OSX/FSEvents.dyn_o )

cbits/c_fsevents.m:1:10: error:
     fatal error: 'CoreServices/CoreServices.h' file not found
  |
1 | #include <CoreServices/CoreServices.h>
  |          ^
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
`cc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build hfsevents-0.1.6. See the build log above for details.

I have Xcode freshly installed and I am able to locate header file at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h

but defining this env var (in my .zshrc) like this doesn't help

export CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/"

UPD: log of cabal install with -v3 https://pastebin.com/FDygnfQB

serhiip avatar Jun 28 '20 21:06 serhiip

I got there with: nix-shell -p darwin.apple_sdk.frameworks.CoreServices -p darwin.objc4.all -p darwin.apple_sdk.frameworks.Cocoa

Apologies for this being a Nix-only solution, but it should give you some idea.

georgefst avatar Dec 13 '20 15:12 georgefst

Does anyone still see this problem? I've never encountered it (I get my GHC installs from GHCup usually).

luite avatar Feb 19 '24 05:02 luite