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

error: 'CGDisplayCreateImageForRect' is unavailable: obsoleted in macOS 15.0 - Please use ScreenCaptureKit instead #108

Open
ryandesign opened this issue Sep 22, 2024 · 2 comments

Comments

@ryandesign
Copy link

Building laf, as part of building Aseprite 1.3.8.1, fails when using the macOS 15.0 deployment target, which is the default when building on macOS 15:

laf/os/osx/system.mm:118:22: error: 'CGDisplayCreateImageForRect' is unavailable: obsoleted in macOS 15.0 - Please use ScreenCaptureKit instead.
  118 |   CGImageRef image = CGDisplayCreateImageForRect(CGMainDisplayID(),
      |                      ^

A workaround is to tell the build to use the macOS 14.0 deployment target (or earlier) by adding the flag -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 when running cmake.

@dacap
Copy link
Member

dacap commented Nov 1, 2024

Hi @ryandesign, in our instructions (at least on Aseprite INSTALL guide) we use:

      -DCMAKE_OSX_ARCHITECTURES=x86_64 \
      -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \

when running cmake, probably if you are on Apple Silicon you will want to use 11.0:

      -DCMAKE_OSX_ARCHITECTURES=arm64 \
      -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \

we should always use the oldest platform possible on macOS.

@ryandesign
Copy link
Author

Yes, if you're distributing a binary to others, you want it to have the widest possible compatibility by using the oldest possible deployment target.

Users building for their own use on their own system don't care about that.

Using an older deployment target does work around the error but you will at some point want to update your code to build without errors when using the macOS 15 or later SDK.

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