I installed SFML for macOS-clang with this video https://www.youtube.com/watch?v=WOyp5n2FmZY. And I setup the Xcode like this video https://www.youtube.com/watch?v=kusRtYC-wj4 but it does not work like in the video. It can be built with no error or warning but when I run this is what happen. Just so you guys know that
- I am an amateur.
- I use MacBook Pro M1 2020.
- I never work with SFML before.
- I just start using Xcode. I am used to work on VSCode before.
- I got Rosetta2 installed.
- Before this I have tried to do it on VSCode with this Boilerplate(https://github.com/andrew-r-king/sfml-vscode-boilerplate.git).
- I also have tried SFML that install via Homebrew.
What should I do? I really need to do this because I have to use it to make my game project for my college. Thank you all in advance.
2
Answers
First, install SFML with brew.
Get location information
You will see /opt/homebrew/Cellar/sfml/2.X.Y in the output. It is the location for headers, lib, etc.
Compile with
Last step is:
Done!
For M1 macs
Header Search Paths
Libary Search Paths
You can add the path to the homebrew installation.
Pay attention for what MacOS version you are building. For MacOS 11.0 and bellow, the only option is to use rosetta…
If your mac has a AppleSilicon, installing sfml with brew will generate arm64 libraries for you. So will need to update the MacOS version in your project and choose the correct test platform in the upper bar, inside Xcode, you should have MyProject > My Mac (Rosetta) or MyProject > My Mac, just Choose "My Mac" if you are using brew.