Problem With SFML

Hey guys

I've decided to start programming with graphics and I've heard SFML is a pretty good library for it. However, I'm having a problem. The code that I copied from the SFML website's tutorial is giving me an an error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}



C:\Users\Stewart\Desktop\C++ Tasks\Projects\SFML\main.o:main.cpp|| undefined reference to `sf::Clock::Clock()'|
C:\Users\Stewart\Desktop\C++ Tasks\Projects\SFML\main.o:main.cpp|| undefined reference to `sf::Clock::GetElapsedTime() const'|
C:\Users\Stewart\Desktop\C++ Tasks\Projects\SFML\main.o:main.cpp|| undefined reference to `sf::Sleep(float)'|
C:\Users\Stewart\Desktop\C++ Tasks\Projects\SFML\main.o:main.cpp|| undefined reference to `sf::Clock::GetElapsedTime() const'|
||=== Build finished: 4 errors, 0 warnings ===|


I'm guessing it's got sometihng to with Code::Blocks not being able to find the SFML library. I have installed it correctly according to the tutorial though.
I assume you got SFML2.0? The tutorials on the site don't have updated code for 2.0 yet, so you'll need to change a few things.
I actually got SFML 1.6
I Would Change to SFML 2.0
Topic archived. No new replies allowed.