In this article, we'll cover how to install the Simple and Fast Multimedia Library (SFML) for C++ projects for Mac. If you'd like to SFML for Windows, please see this article instead: How to Install SFML for Windows
Installing SFML
2. Click the download link from the top menu, and then select the latest stable version download for SFML.
3. On the Download page, scroll down to the macOS option and click the "Download" button.
4. Once downloaded, unzip the file, which should be a tar.gz file.
5. Locate the Library > Frameworks folder from the Macintosh HD location. Then, from your unzipped file, select all of the .framework files and copy them into the Frameworks folder.
6. Locate the “extlibs” folder from the SFML download package and copy this into the Frameworks folder as well.
7. Once that’s done, you’ve successfully installed SFML! You should be able to #include any SFML module in your projects now. However, when compiling and running C++ projects with SFML, you will likely need to link the frameworks in the compile command, such as seen below:
- g++ -o main main.cpp -F/Library/Frameworks -framework sfml-graphics -framework sfml-audio -framework sfml-window -framework sfml-system