SFML community forums
Help => Graphics => Topic started by: Mordicaii 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.
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
#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?
-
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?
-
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.
-
I tried something out of the blue, it worked.
It set the Base SDK (Project->Edit Active Target ...) to "Mac OS X 10.6"