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

Author Topic: Link errors with sfml application template in Xcode 4.3  (Read 2333 times)

0 Members and 1 Guest are viewing this topic.

Asion

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Link errors with sfml application template in Xcode 4.3
« on: July 24, 2012, 03:17:28 pm »
Hello everyone :D

When i try to compile the SFML Application template using libc++ as standard library the linker fails with the following errors:

Code: [Select]
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::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::Font::loadFromFile(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::Music::openFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > 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 noticed that if I use libstdc++ as standard library the code compile just fine but since I'd like to use some c++0x features in my project I need libc++.
I'm using Xcode 4.3.2 on a mid 2012 15 inch macbook pro with the 2.0 rc SFML release.

PS: I'm sorry for my terrible english

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Link errors with sfml application template in Xcode 4.3
« Reply #1 on: July 24, 2012, 05:40:49 pm »
If you want to use clang and libc++ you have to recompile SFML with those tools.
SFML / OS X developer

Asion

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Link errors with sfml application template in Xcode 4.3
« Reply #2 on: July 24, 2012, 08:20:34 pm »
If you want to use clang and libc++ you have to recompile SFML with those tools.

I have recompiled SFML with libc++ and now it works!
Thanks for the help !!

 

anything