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

Author Topic: Unable to compile tutorial on Mac  (Read 1206 times)

0 Members and 1 Guest are viewing this topic.

Mordicaii

  • Newbie
  • *
  • Posts: 3
    • View Profile
Unable to compile tutorial on Mac
« on: July 17, 2011, 09:37:10 pm »
I've run into an odd problem.
I can't find a solution on google, or here.

When I try to compile the basic tutorial, I get a linker error.  I don't think I am missing a library.

This is the error.

Code: [Select]

Undefined symbols:
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, sf::ContextSettings const&)", referenced from:
      _main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


And this is the code

Code: [Select]

#include <SFML/Graphics.hpp>
int main()
{
    // Create main window
    sf::RenderWindow App(sf::VideoMode(640, 480), "SFML Graphics");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear screen
        App.Clear();

        // Finally, display the rendered frame on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}




What could it mean and what can I do about it?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Unable to compile tutorial on Mac
« Reply #1 on: July 17, 2011, 11:05:46 pm »
Have you read the tutorial to setup SFML with your IDE?

Did you link sfml-system(-s)(-d) and sfml-window(-s)(-d), where the postfixes are set according to your static/dynamic, release/debug configuration?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Mordicaii

  • Newbie
  • *
  • Posts: 3
    • View Profile
Unable to compile tutorial on Mac
« Reply #2 on: July 17, 2011, 11:10:40 pm »
Quote from: "Nexus"
Have you read the tutorial to setup SFML with your IDE?

Did you link sfml-system(-s)(-d) and sfml-window(-s)(-d), where the postfixes are set according to your static/dynamic, release/debug configuration?


I've followed all of the directions as per the tutorial for Xcode. (http://www.sfml-dev.org/tutorials/1.6/start-osx.php)

Xcode does all of that configuration for you.
If I were to just use the terminal and attempt to compile it manually, I get the same error.

Mordicaii

  • Newbie
  • *
  • Posts: 3
    • View Profile
Unable to compile tutorial on Mac
« Reply #3 on: July 18, 2011, 12:39:48 am »
I tried something out of the blue, it worked.

It set the Base SDK (Project->Edit Active Target ...) to "Mac OS X 10.6"