My code:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
while(window.isOpen())
{
sf::Event Event;
while(window.pollEvent(Event))
{
if(Event.type == sf::Event::Closed || Event.key.code == sf::Keyboard::Escape)
window.close();
}
window.display();
}
return 0;
}
My compiler call:
g++ main.cpp -framework SFML -lsfml-graphics -lsfml-window -lsfml-system
The error message:
Undefined symbols for architecture x86_64:
"sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)", referenced from:
_main in cc8BMfpR.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Is RenderWindow in a library I forgot to link? I assumed it was in the 'window' one.. I'm running SFML 2.1 and tried various linking combinations, all of which give me linking errors. This linking chain is the one that gives me the least error, namely the RenderWindow error. Someone help me figure this out? I'm at a bit of a loss here. I'm running on mac os 10.8.