title: How to create a window with SDL2 on MacOS
body: <p>I'm trying to create a window with SDL2. I don't get any error while compiling, but I also don't get any window at runtime.</p>
  <p>Here's my code (without error checking for readability).</p>
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;SDL2/SDL.h&gt;
  
  int main(void)
  {
      SDL_Window      *win = NULL;
      SDL_Renderer    *ren = NULL;
  
      SDL_Init(SDL_INIT_EVERYTHING);
      SDL_CreateWindowAndRenderer(320, 640, 0, &amp;win, &amp;ren);
  
      SDL_SetRenderDrawColor(ren, 0, 0, 0, 255);
      SDL_RenderClear(ren);
      SDL_RenderPresent(ren);
  
      SDL_Delay(3000);
  
      SDL_DestroyRenderer(ren);
      SDL_DestroyWindow(win);
      SDL_Quit();
  
      return (0);
  }
  
  </code></pre>
  <p>I also tried <a href="https://wiki.libsdl.org/SDL_CreateWindow" rel="nofollow noreferrer">this</a> code sample from the wiki, same issue.</p>
  <p><strong>Compilation</strong></p>
  <p><code>clang -F /Library/Frameworks -framework SDL2 main.c</code></p>
  <p>I'm working on MacOS Big Sur. I installed the SDL2 from the <code>.dmg</code> file downloaded on <a href="https://www.libsdl.org/download-2.0.php" rel="nofollow noreferrer">their website</a> (runtime binaries / Mac OS X), and placed into the <code>/Library/Frameworks</code> folder</p>
  <p>Is that a compatibility issue? How can I fix it?</p>
  <p><strong>EDIT</strong></p>
  <p>I also tried to install the SDL following <a href="https://medium.com/@edkins.sarah/set-up-sdl2-on-your-mac-without-xcode-6b0c33b723f7" rel="nofollow noreferrer">this tutorial</a>, still same issue.</p>