Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Compiling SFML 2.0 Program on OSX  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

yapshuter63

  • Newbie
  • *
  • Posts: 3
    • View Profile
Compiling SFML 2.0 Program on OSX
« on: March 27, 2013, 10:33:58 pm »
Hey. I am new to SFML, and I want to get started. I read the 2.0 getting started on Mac tutorial, and ran the installer. When I create the project, the SFML templates are there. When I create a project with the SFML template, all the code and images are there, but when I compile, it says that SFML/Graphics.hpp file is not found. Could someone please help me with this?

yapshuter63

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Compiling SFML 2.0 Program on OSX
« Reply #1 on: March 27, 2013, 10:36:33 pm »
Should I change the library search path or somthing? In build settings, library search paths and framework search paths are both empty.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Compiling SFML 2.0 Program on OSX
« Reply #2 on: March 28, 2013, 01:03:02 pm »
There are a number of known (and corrected) bugs with SFML 2.0 RC. You can either search for those issue on this forum + issues tracker, or, better, download the last source and compile SFML yourself (have a look at the cmake tutorial).
SFML / OS X developer

jjjaime

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Compiling SFML 2.0 Program on OSX
« Reply #3 on: March 28, 2013, 02:06:19 pm »
I had the very same problem yesterday  :)

It is related to the include directory. It looks like the latest version of XCode has changed a bit the default include directories.

I installed the latest XCode templates available at:
https://github.com/SFML/SFML/tree/master/tools/xcode/templates

I also had to install the FreeType framework (available at: http://www.kyngchaos.com/software/frameworks).

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Compiling SFML 2.0 Program on OSX
« Reply #4 on: March 28, 2013, 03:53:16 pm »
Freetype + the new Xcode templates are automatically installed when installing the last version of SFML (from github).  ;)
SFML / OS X developer

yapshuter63

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Compiling SFML 2.0 Program on OSX
« Reply #5 on: March 28, 2013, 08:14:34 pm »
Okay, I fixed it, by changing the framework, header, and library search directories. Here are a few instructions:

First, when creating the project, make sure that all the boxes are checked.

Second, change the search directories to their corresponding places in /usr.

Third, make sure your language type is set to C++ 98, and not C++11.
I suspect that compiling SFML yourself will fix the c++11 errors.

I hope this helps someone.   :D