How To Download Sfml Mac

I would like to learn how to download and compile external libraries using the cmake external project module. For example, lets say that I wanted to download the source from the SFML library http.

On This Page

A. Introduction

This document describes how to install SFML on XCode for the course CS-11: Introduction to Programming Concepts and Methodology, C++. For Windows computers, see How to Install SFML in Code::Blocks for Windows. For Linux computers, see How to Install Code::Blocks and SFML for Linux.

SFML is a free and open source library that provides a simple object-oriented interface to graphics, sound and other parts of a personal computer. It has five main modules: system, window, graphics, audio and network.

B. Installing XCode

SFML does not require the latest version of XCode. Any version starting with Lion (10.7) or later is acceptable and there is no need to update to the latest version of XCode.

Installing XCode

If you do not have XCode or want to update, use the following instructions:

  1. Register as an Apple developer at https://developer.apple.com/programs/register/.

    Registering as an Apple developer is free for individuals. The Apple website may imply that you must pay, but the link should take you directly to the free signup page.

  2. Go to Apple Developer and login.

    After login, you can download the latest version of XCode in the Mac App Store as well as older versions.

  3. Once downloaded, install XCode from the disc image (dmg) file. Drag and drop the file into your computer's Application folder.
  4. After installing XCode, download and install the command-line tools as well.

    Command-line tools can be downloaded from the Apple Developer. Some versions of XCode allow you to install the command-line tools from: XCode > Preferences > Downloads > Command Line Tools.

To learn how to use XCode, look up tutorials on the Apple Developer site or with a search engine.

More Information

  • Apple XCode for C and C++: from Cprogramming.com
  • Building from the Command Line with XCode FAQ: from the Apple Developer documentation
Download

C. Installing SFML

  1. Go to the SFML download page and follow the link to the latest stable version.
  2. Download the SFML libraries for your version of XCode and place them in a suitable location.

    Use Clang for OS X 10.7 (Lion 2012) or later. Earlier versions of OS X do not have pre-built downloads.

  3. Open the Terminal application.

    The Terminal application is located in the Utilities subfolder of the Applications folder.

  4. In the Terminal window, cd to the download location.

    For example: cd Downloads

  5. Run the install script by typing: ./install.sh followed by the Enter key.

    The script will prompt you for your password and install the components correctly.

More Information

  • SFML and XCode (Mac OS X): from the SFML tutorials

Sfml Net

D. Creating an SFML Project

In this section we create a test project to verify the SFML installation. We can use these instructions as a starting point for other new projects as well.

  1. Start XCode and select File > New Project... then choose SFML in the left column and double-click on SFML App.
  2. In the next window, fill in the required fields and then press the Next button.
    • If you downloaded the 'GCC' version, select C++98 with GCC and libstdc++ and target 10.5.
    • If you downloaded the 'Clang' version, select C++11 with Clang and libc++.
  3. In the main.cpp file, copy and paste the following program code.
  4. Run the project and verify you see the following graphics window.

Sfml Windows

More Information

  • Create your first SFML program: from the SFML tutorials

Sfml Download

Comments are closed.