rjeczalik / notify

File system event notification library on steroids.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to install it on macOS Mojave

passos opened this issue · comments

install it by following commands:

$ go get -u github.com/rjeczalik/notify
# github.com/rjeczalik/notify
../github.com/rjeczalik/notify/watcher_fsevents_cgo.go:10:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

$ go version
go version go1.11 darwin/amd64

macOS 10.14

if I clone the repo and build it

➜  notify git:(master) go build
go: finding golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7
# github.com/rjeczalik/notify
./watcher_fsevents_cgo.go:10:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
➜  notify git:(master) ✗ go build -x
WORK=/var/folders/sl/pycwhjgs03s_8121kvbnly2h0000gn/T/go-build371896428
mkdir -p $WORK/b001/
cd /Users/simon/workspace/oss/notify
CGO_LDFLAGS='"-g" "-O2" "-framework" "CoreServices"' /usr/local/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/b001/ -importpath github.com/rjeczalik/notify -- -I $WORK/b001/ -g -O2 ./watcher_fsevents_cgo.go
# github.com/rjeczalik/notify
./watcher_fsevents_cgo.go:10:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Try running sudo xcode-select -install and retry building notify.

@rjeczalik Thanks for the reply. I tried but it didn't work.

Finally I found the problem is I installed llvm by brew before. And it can't work with latest code. I remove it by brew uninstall llvm. then the go build use system version llvm and it works.