usb icon indicating copy to clipboard operation
usb copied to clipboard

build error from mac osx 10.15 fatal error: 'IOKit/IOTypes.h' file not found

Open huahuayu opened this issue 5 years ago • 4 comments

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: https://github.com/ethereum/go-ethereum/issues/21835

error info

# github.com/karalabe/usb
In file included from ../../pkg/mod/github.com/karalabe/[email protected]/libs.go:50:
In file included from ../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.c:72:
../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.h:25:10: fatal error: 'IOKit/IOTypes.h' file not found
#include <IOKit/IOTypes.h>
         ^~~~~~~~~~~~~~~~~
../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.h:25:10: note: did not find header 'IOTypes.h' in framework 'IOKit' (loaded from '/System/Library/Frameworks')
1 error generated.

huahuayu avatar Nov 12 '20 09:11 huahuayu

but I can see the header file is here:

/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/IOTypes.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 sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/*  /usr/local/include/

huahuayu avatar Nov 12 '20 09:11 huahuayu

below ln is work!

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

huahuayu avatar Nov 13 '20 02:11 huahuayu

similar issue https://github.com/rjeczalik/notify/issues/196

huahuayu avatar Nov 13 '20 02:11 huahuayu

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: https://github.com/ethereum/go-ethereum/issues/21835

error info

# github.com/karalabe/usb
In file included from ../../pkg/mod/github.com/karalabe/[email protected]/libs.go:50:
In file included from ../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.c:72:
../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.h:25:10: fatal error: 'IOKit/IOTypes.h' file not found
#include <IOKit/IOTypes.h>
         ^~~~~~~~~~~~~~~~~
../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.h:25:10: note: did not find header 'IOTypes.h' in framework 'IOKit' (loaded from '/System/Library/Frameworks')
1 error generated.

Danyalkasiri avatar Aug 31 '22 11:08 Danyalkasiri