window not declared in this scope

Hi i'm useing windows 10 ,codeblocks 1712, sfml 5.2 and after 2 and a half weeks i finally have it working sort of below is the code i'm useing ( its not mine its from a tutorial

)// Include important C++ libraries here
//#include "stdafx.h"
#include <SFML/Graphics.hpp>
// Make code easier to type with "using namespace"
using namespace sf;
int main()
{
// Create a video mode object
VideoMode vm(1920, 1080);
// Create and open a window for the game RenderWindow
window(vm, "Timber!!!", Style::Fullscreen);
return 0;
}

it stops on the next to last lkine of code: window(vm, "Timber!!!", Style::Fullscreen);

with an error 'window was not declared in this scope

what am I doing wrong????
thanks
Trev
window is not a function its a class

try this
 
sf::Window window(sf::VideoMode(800, 600), "My window");
Hi Stav thanks for the superfast reply, i used your line of code and get a new error
expected primary-expression before 'window'

is sfml usually this tricky or is it simply i'm not thincking correctly
SFML is not tricky. You're just not very experienced with C++.

You're also pretty bad at asking questions. We can't see your new code, so it's tricky to see the problem with it.
I was really surprised when you said "SFML 5.2", but then realized you meant 2.5...

Trev, in addition to what Repeater said (learning C++ in general), if you insist on diving right into SFML, why don't you start with the tutorial that the SFML site recommends?

https://www.sfml-dev.org/tutorials/2.5/start-cb.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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 (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;
}
Topic archived. No new replies allowed.