Hello everyone,
I'm trying to compile the SFML 2 tutorial page' s window example:
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
int main()
{
sf::Window window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
}
return 0;
}
Using:
g++ -o SFML2_test ./SFML2_test.cpp -lsfml-window -lsfml-system
But I'm getting:
/tmp/ccBlNedo.o: In function `main':
SFML2_test.cpp:(.text+0x12d): undefined reference to `sf::Window::Window(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
collect2: error: ld returned 1 exit status
SFML 2.0 is now the only version on my system. I installed it via my package manager and the .so' s are in /usr/lib/.