# MacOS Mojave makes SDL2 unaccessible

I have some code that worked with no issues on MacOS Sierra, but when I update to Mojave, my compiler always says that it can't find SDL2.

Here's the error:

20:24:40 **** Incremental Build of configuration Debug for project Causality ****
make all
Building file: ../src/engine/SE.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/engine/SE.d" -MT"src/engine/SE.o" -o "src/engine/SE.o" "../src/engine/SE.cpp"
In file included from ../src/engine/SE.cpp:1:
#include <SDL2/SDL_events.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [src/engine/SE.o] Error 1

20:24:42 Build Failed. 2 errors, 0 warnings. (took 1s.304ms)


I'm using SDL 2.0.9

My project structure is this:

src
|main.cpp
|engine
|SE.h
|SE.cpp
|SE_Audio.h
|SE_Audio.cpp
|SE_Graphics.h
|SE_Graphics.cpp
|SE_Input.h
|SE_Input.cpp
|SE_Structs.h


I'm including the libraries with -framework SDL2 -framework Cocoa -framework SDL2_image

I'm using the exact same settings that I used before and that worked in MacOS Sierra. Please tell me what more details you need before down-voting

• What SDL version are you using? It seems odd that updating your OS would break your include paths, but what does your project structure look like, and how are you specifying the include directories?
– user35344
Nov 17 '18 at 9:59
• @Tyyppi_77 Editted. Nov 17 '18 at 10:01
• I feel like you might have better luck with this question on SO, since this seems more like a generic MacOS include framework issue than a game development / SDL specific thing.
– user35344
Nov 17 '18 at 10:27
• @Tyyppi_77 Maybe I should go on a Mac StackExchange if that exists. StackOverflow's community really doesn't help. Nov 17 '18 at 10:29
• There is an Apple StackExchange, called Ask Different. However, their help center says "Code-level programming questions (cocoa, LLVM, etc…) are off-topic here. We do encourage AppleScript, Automator, and UNIX shell scripting questions as well as how to use tools like Xcode for non-language specific tasks." - so this might be borderline. I'd agree you'd probably get answers fastest on StackOverflow, just because they have more mac users frequenting the site than we do, through sheer volume. Nov 17 '18 at 14:27

I've been on Mojave for a bit and haven't run into any compile issues with SDL2. I also do not use Xcode, but rather compile from the command line interface. In my call to g++ I include framework location with:
-F/Library/Frameworks -framework SDL2 -framework SDL2_image -framework SDL2_ttf -framework SDL2_mixer