Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install SDL2 in mac

I am just getting started with learning OpenGL. I am struggling to setup my environment. This is what I did do far:

  • Downloaded SDL2 binary from https://www.libsdl.org/download-2.0.php for mac.
  • Copied SDL2.framework into ~/Library/Frameworks. This didn't work (copied my command bellow).
  • 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

I am using following command to compile a simple opengl code:

g++ test.cpp glad/glad.c -I/Library/Frameworks/SDL2.framework/Headers -F/Library/Frameworks -framework SDL2

enter image description here

Can someone please help me out ? Not sure what I'm missing.

like image 989
newbie Avatar asked Nov 14 '17 21:11

newbie


1 Answers

brew install SDL2

brew install SDL2_image

brew install SDL2_ttf
like image 83
Shevach Riabtsev Avatar answered Sep 21 '22 12:09

Shevach Riabtsev