'CGDisplayCreateImageForRect' is unavailable: obsoleted in macOS 15.0
w84miracle opened this issue · 0 comments
w84miracle commented
- Robotgo version (or commit ref): v0.110.2
- Go version: 1.22.3
- Gcc version: Apple clang version 15.0.0 (clang-1500.3.9.4) Target: arm64-apple-darwin24.0.0
- Operating system and bit: MacOS 15.0
- Resolution: 2560x1440
- Can you reproduce the bug at Examples:
- Yes (provide example code)
- No
- Not relevant
- Provide example code:
fmt.Println(robotgo.Location())
- Log gist:
>go run main.go
# github.com/go-vgo/robotgo
In file included from ../../go/1.22.3/pkg/mod/github.com/go-vgo/robotgo@v0.110.2/robotgo.go:42:
In file included from ./screen/goScreen.h:14:
./screen/screengrab_c.h:28:21: error: 'CGDisplayCreateImageForRect' is unavailable: obsoleted in macOS 15.0 - Please use ScreenCaptureKit instead.
CGImageRef image = CGDisplayCreateImageForRect(displayID, CGRectMake(o.x, o.y, s.w, s.h));
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:391:33: note: 'CGDisplayCreateImageForRect' has been explicitly marked unavailable here
CG_EXTERN CGImageRef __nullable CGDisplayCreateImageForRect(
^
1 error generated.
Description
The dependency pkg has fix the issue. https://github.com/kbinani/screenshot/pull/24/files
but here the header files need to be updated too.