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

Author Topic: SFML 2 RC Mac getting started tutorial  (Read 6052 times)

0 Members and 1 Guest are viewing this topic.

zuon

  • Newbie
  • *
  • Posts: 15
    • View Profile
SFML 2 RC Mac getting started tutorial
« on: December 04, 2012, 07:30:18 pm »
On this page:
http://www.sfml-dev.org/tutorials/2.0/start-osx.php
following the (suggested) instructions does not lead to success -- it gives the error "'SFML/Graphics.hpp' file not found" when compiled. So I googled some:
https://github.com/SFML/SFML/issues/233
Adding /Library/Frameworks to the "Framework Search Path" in the target's Build Settings gets rid of the "'SFML/Graphics.hpp' file not found" error. (I'm not sure if this is the correct place to put it though). But then I get undefined symbols from the linker. I can't find a place to put /usr/local/include and /usr/local/lib that makes it work. I tried "Header Search Paths" and "Library Search Paths" respectively. The problem seems to be fixed on your end, but what am I supposed to do? I don't know where to plop in the new version of the template, I don't know what to change in my project, I can't just download a newer installer, and any sane person is going to move to a different library before they do anything complicated to get the Hello World program working.

So please update the tutorial page to include fixes that can't be put in an installer.

(PS: from what I googled, I'm thinking this problem isn't unique to me. But if it is, this post is obviously in the wrong spot, and I'm willing to spend some time figuring out what the solution is.)

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML 2 RC Mac getting started tutorial
« Reply #1 on: December 05, 2012, 03:15:43 pm »
what kind of undefined symbols ?
SFML / OS X developer

zuon

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: SFML 2 RC Mac getting started tutorial
« Reply #2 on: December 05, 2012, 07:52:29 pm »
Like so:

Undefined symbols for architecture x86_64:
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main.o
  "sf::Font::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main.o
  "sf::Music::openFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main.o
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
      _main in main.o
  "sf::Texture::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > 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)

I assume it's every SFML function called in the template program.

firefly2442

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: SFML 2 RC Mac getting started tutorial
« Reply #3 on: December 07, 2012, 04:58:18 am »
Have you tried using CMake?  This may be better at setting the location of the header files and generating a solution.


zuon

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: SFML 2 RC Mac getting started tutorial
« Reply #5 on: December 07, 2012, 06:23:56 pm »
So, the reason the C++11 part of the tutorial doesn't help (ie why you have 4 threads of the same problem now, and why I'm vindicated in putting this in the website section) is that

1) I'm not using C++11 so I ignored that section. Even if XCode ships with C++11, why would the template you gave me default to C++11 which is NOT what the libraries you gave me work with? If the installer is out of date and hard to update, fine, but it doesn't mean you can't do anything.
2) There's no "if you're getting linker errors look here".
3) There's no mention of libstdc++. You are told how to get C++11 working, not how to get the template working.

So at this point I've got mine, but why not update the tutorial to be a bit more obvious for people who just want to compile the Hello World project by following the alpha path? The headers search path thing should also be in there.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML 2 RC Mac getting started tutorial
« Reply #6 on: December 08, 2012, 10:58:04 am »
Simply because I currently don't have time to update the tutorial (or anything else for that matter). Remember that we're working on SFML on our free time.

For the record, when the RC was released, Xcode default settings were not yet configured to use C++11/clang/libc++. Most of the issues I'm having are due to some Apple's update. And the templates are a pain in the neck to write as there is no documentation anywhere.

On 2), I would always recommend the search feature of the forum, or google more generally. It's better than nothing. Moreover, keeping track of all issues in a FAQ is time-consuming. So searching is beneficial for everyone.

BTW, the templates have been planed to be update soon and to handle such issue.
SFML / OS X developer