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

Author Topic: Tutorial App Won't Build  (Read 2206 times)

0 Members and 1 Guest are viewing this topic.

Caleb P

  • Newbie
  • *
  • Posts: 4
    • View Profile
Tutorial App Won't Build
« on: February 05, 2014, 01:41:23 pm »
I'm a complete newbie to graphical apps (only done C++ command-line utilities), so I was delighted when I found SFML (it seems to be quite easy to use). I downloaded and installed it just as the tutorial (http://www.sfml-dev.org/tutorials/2.1/start-osx.php) says, but when I clicked "Run", I get 35 errors and "Build Failed". I'm on Mavericks with XCode 5.0.2.

Here are the errors I'm getting:
Undefined symbols for architecture x86_64:
  "sf::SoundStream::play()", referenced from:
      _main in main.o
  "sf::RenderStates::Default", referenced from:
      _main in main.o
  "sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)", referenced from:
      _main in main.o
  "sf::RenderTarget::clear(sf::Color const&)", referenced from:
      _main in main.o
  "sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main.o
  "sf::RenderWindow::~RenderWindow()", referenced from:
      _main in main.o
  "sf::Transformable::~Transformable()", referenced from:
      sf::Sprite::~Sprite() in main.o
      sf::Text::~Text() 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::Font::Font()", referenced from:
      _main in main.o
  "sf::Font::~Font()", referenced from:
      _main in main.o
  "sf::Text::setColor(sf::Color const&)", referenced from:
      _main in main.o
  "sf::Text::Text(sf::String const&, sf::Font const&, unsigned int)", referenced from:
      _main in main.o
  "sf::Color::Black", referenced from:
      _main in main.o
  "sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)", referenced from:
      _main in main.o
  "sf::Image::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main.o
  "sf::Image::Image()", 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::Music::Music()", referenced from:
      _main in main.o
  "sf::Music::~Music()", referenced from:
      _main in main.o
  "sf::Sprite::Sprite(sf::Texture const&)", referenced from:
      _main in main.o
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
      _main in main.o
  "sf::Window::close()", referenced from:
      _main in main.o
  "sf::Window::display()", referenced from:
      _main in main.o
  "sf::Window::setIcon(unsigned int, unsigned int, unsigned char const*)", referenced from:
      _main in main.o
  "sf::Window::pollEvent(sf::Event&)", 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
  "sf::Texture::Texture()", referenced from:
      _main in main.o
  "sf::Texture::~Texture()", referenced from:
      _main in main.o
  "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
      _main in main.o
  "sf::Image::getPixelsPtr() const", referenced from:
      _main in main.o
  "sf::Image::getSize() const", referenced from:
      _main in main.o
  "sf::Window::isOpen() const", referenced from:
      _main in main.o
  "vtable for sf::VertexArray", referenced from:
      sf::VertexArray::~VertexArray() in main.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for sf::Text", referenced from:
      sf::Text::~Text() in main.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Tutorial App Won't Build
« Reply #1 on: February 05, 2014, 01:57:24 pm »
I'm not familiar with XCode, but you seem to have a linking error, did you chose the right compiler ? Are the lib files in the right folder ? Does the project know where to find libs ? Are the lib for 32b and your XCode searching for 64b ones ?

Caleb P

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Tutorial App Won't Build
« Reply #2 on: February 05, 2014, 04:32:14 pm »
I managed to get it working by manually adding the framework libraries... Strange, because the tutorial has XCode adding them automatically in a "Frameworks" folder.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Tutorial App Won't Build
« Reply #3 on: February 09, 2014, 12:40:27 pm »
Did you download the fix for Xcode 5? («Templates for Xcode 5» on the download page)
SFML / OS X developer