Grr... Errors... why?

Why am I getting this error :(
1
2
3
main.cpp:22:81: error: declaration of ‘button::button(int, int, int, int)’ outside of class is not definition [-fpermissive]
 button::button (int xLowerLeft, int xLowerRight, int yParamTop, int yParamBottom);

Here is the "problem" code according to the compiler (g++):
(I know there are a lot of other errors, but I understood why they were happening. Why is this error popping up?)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//using sfml, thats why all the sf::'s are there. sfml provides most of the classes eg. sf::Vector2i. the s at the end of every private integer means store
class button {
public:
button();
button (int xLowerLeft, int xLowerRight, int yParamTop, int yParamBottom);
bool getClicked(sf::window * windowPoint);
private:
bool getIfHovering(sf:: window * windowPoint);
int xLowerLefts;
int xLowerRights;
int yParamTops;
int yParamBottoms;
};
button::button()
{
	//do nothing
}

button::button (int xLowerLeft, int xLowerRight, int yParamTop, int yParamBottom);
{
int xLowerLefts = xLowerLeft;
int xLowerRights = xLowerRight;
int yParamTops = yParamTop;
int yParamBottoms = yParamBottom;
}
bool button::getClicked()
{
	if (button::getIfHovering())
	{
		return true;
	}
	if (!button::getIfHovering())
	{
		return false;	
	}
}

bool button::getIfHovering(sf::Window * windowPoint)
{
	sf::Vector2i localPosition = sf::Mouse::getPosition(*windowPoint); // window is a sf::Window
	int mousesXpos = 0;
	int mousesYpos = 0;
	mousesXpos = floor(localPosition.x);
	mousesYpos = floor(localPosition.y);
	if (mousesXpos > xLowerLefts && mousesXpos < xLowerRights && mousesYpos < yParamTops && mousesYpos > yParamBottoms)
	{
		return true;
	}
	else
	{
		return false;
	}

}

*Facepalm* i re-proofread code. I'm sorry i posted this. had a ; a the end of the line DERP.
Last edited on
Topic archived. No new replies allowed.