Skip to content

CGDisplayCreateImageForRect has been explicitly marked unavailable #62

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

Open
juancer opened this issue Oct 30, 2024 · 1 comment
Open

Comments

@juancer
Copy link

juancer commented Oct 30, 2024

I'm trying to execute the code from scratch on my local machine, and I'm getting this error:

# github.com/go-vgo/robotgo
In file included from ../pkg/mod/github.com/go-vgo/robotgo@v1.0.0-rc2.1/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.
   28 |         CGImageRef image = CGDisplayCreateImageForRect(displayID, CGRectMake(o.x, o.y, s.w, s.h));
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:391:33: note: 'CGDisplayCreateImageForRect' has been explicitly marked unavailable here
  391 | CG_EXTERN CGImageRef __nullable CGDisplayCreateImageForRect(
      |                                 ^
1 error generated.

My builded file is working at 30%, failing a lot, and that's the reason that I'm using the code directly to execute it...

Macbook pro M3, OS Version 15.1 (24B83)

@juancer
Copy link
Author

juancer commented Mar 18, 2025

any option @prashantgupta24?

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

1 participant