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

Author Topic: SFML template has >20 errors on Xcode  (Read 2028 times)

0 Members and 1 Guest are viewing this topic.

mishajw126

  • Newbie
  • *
  • Posts: 4
    • View Profile
SFML template has >20 errors on Xcode
« on: July 11, 2013, 05:15:48 pm »
I've recently downloaded and installed SFML into my copy of Xcode, and when I open a new template, 20 errors show up, saying that certain SFML objects have no member named whatever.

(I installed using the frameworks, but tried with the dylibs too)

Thanks for any help!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML template has >20 errors on Xcode
« Reply #1 on: July 11, 2013, 09:38:23 pm »
You probably haven't installed it correctly (or haven't properly uninstall a previous version). Follow carefully the official tutorial.
SFML / OS X developer

mishajw126

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML template has >20 errors on Xcode
« Reply #2 on: July 12, 2013, 11:50:47 am »
I've followed the tutorial religiously, as well as this one: http://www.mjbshaw.com/2013/02/building-sfml-2-with-c11-on-os-x.html

When only this is in main.cpp:

int main(int, char const**)
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

   
    return EXIT_SUCCESS;
}



These errors show up:

ld: warning: directory not found for option '-L/usr/local/lib'
Undefined symbols for architecture i386:
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, sf::WindowSettings const&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML template has >20 errors on Xcode
« Reply #3 on: July 12, 2013, 11:55:10 am »
It seems that you still have SFML 1.6 installed, and this is what XCode uses with your 2.0 template.
Laurent Gomila - SFML developer

mishajw126

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML template has >20 errors on Xcode
« Reply #4 on: July 12, 2013, 12:01:13 pm »
I had never installed 1.6 in the first place.

I downloaded SFML-2.0 from the bottom of this page: http://www.sfml-dev.org/download/sfml/2.0/

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML template has >20 errors on Xcode
« Reply #5 on: July 12, 2013, 12:06:39 pm »
If you're using c++11/clang/libc++, you need to download the other version of the binaries, cf. the /official/ tutorial.

edit: see Laurent's answer below.
« Last Edit: July 12, 2013, 12:17:45 pm by Hiura »
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML template has >20 errors on Xcode
« Reply #6 on: July 12, 2013, 12:14:58 pm »
You do have SFML 1.6 headers installed.

Look:

Quote
Undefined symbols for architecture i386:
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<...> const&, unsigned long, sf::WindowSettings const&)"

sf::WindowSettings is an old 1.6 structure, it is named sf::ContextSettings in SFML 2.
And the std::basic_string argument is a sf::String in SFML 2.
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML template has >20 errors on Xcode
« Reply #7 on: July 12, 2013, 12:18:02 pm »
Good catch!
SFML / OS X developer

mishajw126

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML template has >20 errors on Xcode
« Reply #8 on: July 12, 2013, 12:18:49 pm »
That was it, thanks a lot!

For anyone else with the same issue, just follow the aforementioned tutorial, but where it says -DSFML_BUILD_FRAMEWORKS='ON' \ replace it with = 'OFF'