odd compile error on SFML

I get the error on compiling:
./test2: symbol lookup error: ./test2: undefined symbol: _ZN2sf6WindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <SFML/Window.hpp>
#include <SFML/Graphics.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();
        }
    }
}


compile:
g++ -std=c++11 -Wall -o "%e" "%f" -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system &&"./%e"

i am installing sfml 2.1 on a fresh ubuntu distro

EDIT:
The SFMl location is in /usr/local
Last edited on
It's saying the sf::Window constructor is not in any of the libraries you linked in. Sorry, no idea. Maybe you're using different versions of headers and libraries?
Topic archived. No new replies allowed.