title: Install SDL2 in mac
body: <p>I am just getting started with learning OpenGL. I am struggling to setup my environment. This is what I did do far:</p>
  
  <ul>
  <li>Downloaded SDL2 binary from <a href="https://www.libsdl.org/download-2.0.php" rel="noreferrer">https://www.libsdl.org/download-2.0.php</a> for mac.</li>
  <li>Copied SDL2.framework into ~/Library/Frameworks. This didn't work (copied my command bellow).</li>
  <li>Then I tried to copy SDL2.framework into /System/Library/Frameworks. However I am not not being able to enable write permission there. It's my personal mac. I'm not sure whats going on. I tried to copy it with "sudo ~/Downloads/SDL* /System/Library/Framework" but it didn't work</li>
  </ul>
  
  <p>I am using following command to compile a simple opengl code:</p>
  
  <pre><code>g++ test.cpp glad/glad.c -I/Library/Frameworks/SDL2.framework/Headers -F/Library/Frameworks -framework SDL2
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5Od9e.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5Od9e.png" alt="enter image description here"></a></p>
  
  <p>Can someone please help me out ? Not sure what I'm missing.</p>