Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error from mac osx 10.15 fatal error: 'CoreServices/CoreServices.h' file not found #196

Open
huahuayu opened this issue Nov 12, 2020 · 8 comments

Comments

@huahuayu
Copy link

hi, when I build a project which depends on notify in mac osx 10.15 , it gets below error

the detail step is described here: would you please to check: ethereum/go-ethereum#21835

error info

# github.com/rjeczalik/notify
../../pkg/mod/github.com/rjeczalik/[email protected]/watcher_fsevents_cgo.go:10:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../pkg/mod/github.com/rjeczalik/[email protected]/watcher_fsevents_cgo.go:10:10: note: did not find header 'CoreServices.h' in framework 'CoreServices' (loaded from '/System/Library/Frameworks')
1 error generated.
@huahuayu
Copy link
Author

huahuayu commented Nov 12, 2020

but I see the header is here

/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h

I made symbolic links to /usr/local/include/ but not working, it seems loaded from '/System/Library/Frameworks', I don't know the specific path, why not read from /usr/local/include/

sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/*  /usr/local/include/

@huahuayu
Copy link
Author

below ln is work!

sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers /System/Library/Frameworks/CoreServices.framework

@huahuayu
Copy link
Author

but after this been fixed, another issue occurs :(

# github.com/rjeczalik/notify
In file included from ../../pkg/mod/github.com/rjeczalik/[email protected]/watcher_fsevents_cgo.go:10:
/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:10: fatal error: 'AE/AE.h' file not found
#include <AE/AE.h>
         ^~~~~~~~~
1 error generated.

@rjeczalik
Copy link
Owner

Hey @huahuayu, you need to ensure your xcode installation is sound, as well your system packages. Please see those issues for a reference:

#180
#165

@huahuayu
Copy link
Author

I have read the issue you linked, no use.

I have latest xcode from appstore, I installed it three days ago, and today it's has 12.2 updates, I upgrade as well.

Now my xcode version is : 12.2

I am trying download 12.3 beta.xip ...

@huahuayu
Copy link
Author

xcode 12.3 beta is installed, no use

@rjeczalik
Copy link
Owner

rjeczalik commented Nov 14, 2020

@huahuayu There are some others topic on this very issue:

https://trac.macports.org/ticket/46628

In other words it is not an issue with notify, it is an issue with devel packages on the system. Something is apparently missing, notify has not way of fixing that.

You could try using kqueue on macOS, which does not require working CGO -

go build -tags kqueue <you cmd>

@huahuayu
Copy link
Author

huahuayu commented Nov 16, 2020

I upgrade to macos 11, and it removes the ln I created in /System/Library/Frameworks/CoreServices.framework, the issue is still there

$ go build ./...
# gopkg.in/olebedev/go-duktape.v3
In file included from _cgo_export.c:4:
debugger.go:23:13: warning: unused function '_duk_debugger_attach' [-Wunused-function]
# github.com/rjeczalik/notify
../go/pkg/mod/github.com/rjeczalik/[email protected]/watcher_fsevents_cgo.go:10:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../go/pkg/mod/github.com/rjeczalik/[email protected]/watcher_fsevents_cgo.go:10:10: note: did not find header 'CoreServices.h' in framework 'CoreServices' (loaded from '/System/Library/Frameworks')
1 error generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants