Class sf :: RenderWindow 'does not have a name named' clear '

I spent at least 5 hours trying to get the sfml library to work with my QT-creator idea. I followed this tutorial https://github.com/LaurentGomila/SFML/wiki/Tutorial%3A-Compile-and-Link-SFML-with-Qt-Creator , but still no luck.
I keep getting the error that class members do not exist after creating simple code. I can create instances of classes, but when trying to use several
member errors of created objects. I tried looking for library related problems, sfml problems, but I don't think I'm looking for the right problem.

This works and displays a window that will never be closed until you close the program:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    //sf::CircleShape shape(100.f );
    //shape.setFillColor(sf::Color::Green);

    while (true)//window.isOpen())
    {
        sf::Event event;
        /*while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }*/

        //window.clear();
        //window.draw(shape);
        //window.display();
    }

    return 0;
}

As soon as I delete one comment, a tooltip appears. I can’t understand what is happening in life.

Thanks in advance.

additional information

Operating Systems: Ubuntu 12.10 Live (installed on the hard drive)

Project file I'm sure this is wrong
TEMPLATE = app

#CONFIG += console

CONFIG -= qt

SOURCES += main.cpp

LIBS += -L"/home/user/Projects/SFML/lib"

CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-network -lsfml-window -lsfml-system

CONFIG(debug, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-network -lsfml-window -lsfml-system

INCLUDEPATH += "/home/user/Projects/SFML/include"

DEPENDPATH += "/home/user/Projects/SFML/include"


Errors:  I will send compilation output
main.cpp: In function 'int main()':

main.cpp:6:5: error: 'CircleShape' is not a member of 'sf'

main.cpp:6:21: error: expected ';' before 'shape'

main.cpp:7:5: error: 'shape' was not declared in this scope

main.cpp:12:23: error: 'class sf::RenderWindow' has no member named 'pollEvent'

main.cpp:14:23: error: 'class sf::Event' has no member named 'type'

main.cpp:15:24: error: 'class sf::RenderWindow' has no member named 'close'

main.cpp:18:16: error: 'class sf::RenderWindow' has no member named 'clear'

main.cpp:19:16: error: 'class sf::RenderWindow' has no member named 'draw'

main.cpp:20:16: error: 'class sf::RenderWindow' has no member named 'display'

16:25:10: The process "/usr/bin/make" exited with code 2.

Error while building project sfmlTest (target: Desktop)

When executing build step 'Make'

Completed path
make: Leaving directory `/home/username/Documents/Projects/c++/Sfml/sfmlTest-build-desktop-Qt_4_8_1_in_PATH__System__Release'


 Compiler Used:  I believe that the Gnu compiler, g ++
+4
source share
1 answer

100%, Ubuntu, , SFML apt-get install sfml-dev, , , SFML 1.6, SFML 2.x. SFML 1.6 CamelCase SFML 2.0 camelCase.

SFML 2.x, SFML, SFML .

+4

All Articles