Sfml Vectors errors

I am making my first graphical game, and I found that there was an error in one of my functions, upon using a Vector2i named MouseCoords, I used it in a function once and it worked like a marvel but when I used it in another part of the code, it gave me an error:

1
2
3
4
5
6
7
8
9
10
11
Vector2i MouseCoords();
int input(){
    if(Mouse::isButtonPressed(Mouse::Left)){
        MouseCoords() = Mouse::getPosition(window);
        click = 1;
    }
    else if(Mouse::isButtonPressed(Mouse::Right)){
        MouseCoords() = Mouse::getPosition(window);
        click = 2;
    }
}

This is just a sample of my code, and it gives me this error:
 
Undefined reference to 'MouseCoords'

I am using SFML 2.1
Thank you for your help.
1
2
3
Vector2i MouseCoords(); //a function
Vector2i MouseCoords; //an object, uses the default constructor
Vector2i MouseCoords{}; //an object, uses the default constructor 
Thank you!
Topic archived. No new replies allowed.