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

Author Topic: Xcode & SFML: Getting the Mac tutorial to work  (Read 3278 times)

0 Members and 1 Guest are viewing this topic.

darchitect

  • Newbie
  • *
  • Posts: 2
    • View Profile
Xcode & SFML: Getting the Mac tutorial to work
« on: January 04, 2013, 08:38:46 am »
As I'm sure many mac users have discovered, the first tutorial doesn't work out of the box. I kept getting the "library not found for -lsfml-system-d" error. I managed to fix that, but it turns out there are a couple of other borked things in the SFML mac template.

To get the mac tutorial to work, do the following:

  • Click on your project in the top left. In the secondary pane to the right, make sure "Targets" is selected. In the third pane to the right, click on "Build Settings"
  • Next, scroll down until you get to "Search Paths". In the blank area to the right of "Library Search Paths" type: usr/local/lib/
  • Now, continue scrolling down until you hit "Apple LLVM Compiler 4.1 - Language". See where it says "C++ Standard Library"? Change the option to "Compiler Default."
  • Finally, scroll to the very bottom under "User-Defined". Find the section where it says SFML_LINK_DYLIBS_SUFFIX. There's a "-d" next to "Debug". Delete that so there's nothing there.

Now you can hit the Run button and it will work.

Hope this helps some people.

Please note, this was done using Xcode 4.5.2 and OS 10.7.5 and the "bare hands" installation of SFML using the dylibs, (no frameworks) so you may have to do something different if you did an install with just the frameworks. Also, I'm a total noob, but after finally getting this working, I thought I'd share what I managed to figure out from multiple posts.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Xcode & SFML: Getting the Mac tutorial to work
« Reply #1 on: January 04, 2013, 09:52:41 am »
good summary of the RC's issues. (note that some are already fixed with the github version)

one small correction though :
3/ you should not use compiler default as it will produce some similar error (depending on the version of Xcode and OS X). instead use libstdc++.

if you want/need C++11 features then recompile SFML as stated in the OS X tutorial and you will be able to use clang + libc++.
SFML / OS X developer

 

anything