SDL 2.0.10, Old Mac OS El Capitan 10.11, and (xcode7.3)?

Hi,

I get the following error (at end of post) trying to build SDL 2.0.10 with an older mac(macOS 10.11), with xcode7.3 travis CI image (and image: xcode8).

Is there a way to make SDL 2.0.10 compile so it supports older versions of Mac OSX with a newer version of xcode?

If xcode7.3 is supposed to be supported by SDL, then I’ll report a bug? I wonder if this also means that SDL 2.0.10 doesn’t work on Mac OS 10.11 El Capitan?

cheers,

==> ./configure --prefix=/usr/local/Cellar/sdl2/2.0.10 --without-x
==> make install
Last 15 lines from /Users/travis/Library/Logs/Homebrew/sdl2/02.make:
  CC     build/SDL_cocoaopengles.lo
  CC     build/SDL_cocoashape.lo
  CC     build/SDL_cocoavideo.lo
  CC     build/SDL_cocoavulkan.lo
  CC     build/SDL_cocoawindow.lo
  CC     build/SDL_render_metal.lo
/private/tmp/sdl2-20190829-31479-1nmyf53/SDL2-2.0.10/src/video/cocoa/SDL_cocoawindow.m:1119:52: error: use of undeclared identifier 'NSEventSubtypeMouseEvent'
    const BOOL istrackpad = ([theEvent subtype] == NSEventSubtypeMouseEvent);
                                                   ^
/private/tmp/sdl2-20190829-31479-1nmyf53/SDL2-2.0.10/src/video/cocoa/SDL_cocoawindow.m:1164:52: error: use of undeclared identifier 'NSEventSubtypeMouseEvent'
    const BOOL istrackpad = ([theEvent subtype] == NSEventSubtypeMouseEvent);

2 errors generated.
make: *** [build/SDL_cocoawindow.lo] Error 1
make: *** Waiting for unfinished jobs....

The oldest OS version SDL can run on is separate from the oldest Xcode version it can be compiled on. By default, SDL will run on OS versions as old as macOS 10.6 even when you compile it using the latest Xcode version.

That being said, it is a bug in SDL 2.0.10 that it can’t be compiled using the 10.11 SDK, but it’s been fixed in the latest source code (downloadable via the top of https://hg.libsdl.org/SDL/ ). In general it’s usually best to use the latest possible stable SDK when building, though.

Thanks for the info. Do you know which commit(s) fix the compilation issue?

cheers,

Info for curious internet travellers coming by this post… On travis CI image: xcode8.3 is the oldest one which works with sdl 2.0.10.

Thanks! With that patch SDL 2.0.10 with travis CI image:xcode7.3 compiles.

Hi. I encountered the exact same error as Rene when I tried to install sdl 2.0.10 using Homebrew.

I’m not a dev, though I am very comfortable using a CLI. I don’t have XCode installed, so I install Unix type packages using Homebrew. (I’m installing sdl because it’s a dependency for the minidlna package.) I found this forum when searching the web for a solution.

Is there a way I can work around this compilation bug using Homebrew, without having to compile the code myself? Is there a command line flag to point Homebrew at the preferred source code? Or something? Thank you for any help you can provide!

EDITED TO ADD: by the way, I currently have sdl 2.0.8 installed… it was a dependency for a previous package install I think… in case that makes a difference to your response.

Hi @Gord77

If you edit your local formular, and add the patch in it should work:

brew edit sdl2

Add this patch into the Formula…

  # Fix 10.11 compilation.
  patch :p0 do
    url "https://gist.githubusercontent.com/illume/ac2eb4daa1bd805255d5355806acf822/raw/7e3c83f760fe5bf61a9f6bcc196ed9be6f6e22da/sdl2-mac-10-11.patch"
    sha256 "25f534e35f92244f006e4d2e5740bc65f502136ffa5ebe8427963434bd46f590"
  end

And… this time it worked! Thanks so much for your help.

1 Like