Weird Problem with XCode, SDL2, and Catalina

Using XCode 11.4, the latest SDL framework download, and MacOS Catalina on a MacBook air.

I’ve included the SDL2.framework into the project. The autocomplete in the editor finds the SDL2/sdl.h header, and the first compile works and runs. Immediately afterwards, the editor tags the #include line with “‘SDL2/sdl.h’ file not found” and it no longer builds.

If I create a new project, add the framework again and copy/paste the code, it will again build and run the first time, then fail in the same way.

Anyone know what is going on?

I am experiencing the same exact problems on Mojave and XCode 11.3

Thanks in advance.

try this syntax; #include <SDL2/SDL.h>

Do I #include <SDL.h> or <SDL/SDL.h>?

The most portable way to include SDL headers is to use quotes around the header name:

#include “SDL.h”

Yeah ive been having the same problem as well. i found the clearing the cache with cmd + shift + k helps it build again but no permanent fix.

Since the framework is SDL2, you have to do

#include <SDL2/SDL.h>