SFML community forums

Help => General => Topic started by: cubefest on August 17, 2014, 09:26:30 pm

Title: Error on example build
Post by: cubefest on August 17, 2014, 09:26:30 pm
I am trying to do the first build on mac osx mavericks with Xcode 5.1.1 but I keep on running into errors about this code that is supposed to just compile and work. I have looked around the internet and found the solution to my first problem which was a linker problem caused by needing to update the frameworks to be compatible with Xcode 5, but I am stuck with this most recent issue. I can't figure out what this error is from:

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)
Title: Re: Error on example build
Post by: Hiura on August 17, 2014, 09:57:40 pm
Read the red parts carefully. http://sfml-dev.org/tutorials/2.1/start-osx.php If still confused, ask but there should be plenty of similar post on this forum and SO.
Title: Re: Error on example build
Post by: cubefest on August 17, 2014, 10:51:41 pm
It would seem as if it were a conflict about clang vs gcc, but I was very careful when choosing the compiler and source - I even redid it to double check. None of the red parts helped either. I think I must be missing something rather blatant, but I can't seem to find it. Also, sorry about being a newbie, I've looked at past posts and you have dealt with this kinda problem countless times it seems.
Title: Re: Error on example build
Post by: cubefest on August 17, 2014, 10:59:19 pm
Fixed the issues. I set SFML binaries to dylib and it works. I must not have actually set up the framework correctly. Sorry for the trouble.