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

Author Topic: Incapable of making SFML 2.1 work on Xcode 4.6  (Read 1126 times)

0 Members and 2 Guests are viewing this topic.

Antonio Garosi

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Incapable of making SFML 2.1 work on Xcode 4.6
« on: November 20, 2013, 03:06:49 pm »
Hi everybody,
First post, so please, don't be cruel.
I've seen that many other people encountered this kind of problem (or similar), but I couln't find a proper solution, or even a proper explanation.
So I want to try to recap.

I've got a Macbook with Maverick working on. The issue comes out when you try to build the last stable version of SFML on Xcode 4.6.
First of all, the install.sh isn't written to find the proper location of the Xcode template (since in the new version it isn't  /Library/Developer/Xcode/Templates/, it is /Applications/Xcode.app/Contents/Library/Develper/Xcode/Templates/Project Templates/Mac/).
If you move the file manually everything seems to be fine, until you try to open your first project with the SFML template.
Now, the problem may vary due to the choiche of the compiler.
If you use "C++11 with Clang and libstdc++", the one suggested by the tutorial,  when you try to build a project (the default one, i.e.) you get a pack of six errors titled "Apple Mach-0 Linker (Id) Error".
In more detail, the debugger refers:

Undefined symbols for architecture x86_64:
  "sf::Font::loadFromFile(std::string const&)", referenced from:
      _main in main.o
  "sf::Image::loadFromFile(std::string const&)", referenced from:
      _main in main.o
  "sf::Music::openFromFile(std::string const&)", referenced from:
      _main in main.o
  "sf::String::String(char const*, std::locale const&)", referenced from:
      _main in main.o
  "sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If you use "C++98 with Clang and libstdc++" when you try to build a project the build never ends. The compiler gets stuck in the "Creating universal binary" process, and never gets out from that.
If you use "C++98 with Clang and libstdc++ and Target 10.5" you get several errors by the debugger, and you think that obviuously you made something wrong.

How can I solve this?

I've already:
- Tried to compile both APP e CTL. CTL seems to works at first glance, but then you realize that none of the functions is working fine.
- Tried to configure properly SFML with Cmake, with several customizations, but the results don't change.
- Tried to move, define and remove every libraries and frameworks as already proposed by various users on the web.
- Tried to scape a goat in a marble altar and offered fruits and goods to obscure deities.

I'm pretty a basic user, so I can't diagnose or propose anything consistent, but to me it seems like that the framework simply doesn't fit in the IDE.

Is there anybody so good and nice to suggest the right path to follow to reach the magnificient and craved SFML?

Antonio Garosi

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Incapable of making SFML 2.1 work on Xcode 4.6
« Reply #1 on: November 21, 2013, 09:10:18 am »
I solved everything.... by simply upgrading to XCode 5 and installing the new templates.
I guess all my problem where linked to my stubborn attitude to use exclusively XCode 4.6.
And all considered I can bet that the problem was really about the templates (the Readme file of the XCode 5 templates says that they can be used even in XCode 4).
Just one clarification: the install.sh wasn't working properly for me, so I had to create the right folders and move the files myself.

I hope my hard labour will be helpful even for other people.

See ya.