I'm new to macOS development. I'm trying to use Xcode to compile a small program with SDL. I wrote it in Linux and I can compile it on macOS using a simple Makefile. I'm now working on getting it to build with Xcode.
I'm guessing that the instructions refer to the SDL2-2.30.7.dmg file. When I download it an open it, I don't see the Xcode.tar.gz file there, only the SDL2.framework directory.
Instructions then say "To Install: Copy the SDL2.framework to /Library/Frameworks". I'm working as a regular user with regular user privileges. Trying to copy the directory naively into /Library/Frameworks fails with an error message that I don't have write permissions there.
mv: rename SDL2.framework to /Library/Frameworks/SDL2.framework: Permission denied
I moved the directory to /Library/Frameworks using sudo, but then it wasn't clear to me what I can do next. Instructions then say that I can simply open the project and build it, but when I try to open SDL2.framework with Xcode, I'm getting an error saying "Could not open file. (/Users/.../SDL2.framework)".
That's really strange, because it is a directory, I can see it, and I can cd into it and see the files and symlinks inside. I'll keep on trying, but there's something non-obvious here, could you elucidate what kind trap am I falling into?
Hello,
I'm new to macOS development. I'm trying to use Xcode to compile a small program with SDL. I wrote it in Linux and I can compile it on macOS using a simple Makefile. I'm now working on getting it to build with Xcode.
I have a question regarding this line here:
https://github.com/libsdl-org/SDL/blob/090e30dbca3379a32097652a73ba77116e25a417/docs/README-macos.md?plain=1#L174
I'm guessing that the instructions refer to the SDL2-2.30.7.dmg file. When I download it an open it, I don't see the
Xcode.tar.gz
file there, only theSDL2.framework
directory.Instructions then say "To Install: Copy the SDL2.framework to /Library/Frameworks". I'm working as a regular user with regular user privileges. Trying to copy the directory naively into /Library/Frameworks fails with an error message that I don't have write permissions there.
I moved the directory to
/Library/Frameworks
using sudo, but then it wasn't clear to me what I can do next. Instructions then say that I can simply open the project and build it, but when I try to open SDL2.framework with Xcode, I'm getting an error saying "Could not open file. (/Users/.../SDL2.framework)".Looking for other sources I found this tutorial here: https://lazyfoo.net/tutorials/SDL/01_hello_SDL/mac/xcode/ -- but that also doesn't work. It seems like Xcode thinks that
SDL2.framework
is a file rather a directory.That's really strange, because it is a directory, I can see it, and I can
cd
into it and see the files and symlinks inside. I'll keep on trying, but there's something non-obvious here, could you elucidate what kind trap am I falling into?