Why does my class definition constructor does not meet its declaration? [closed]

  c++, sdl-2

I’ve been researching through the internet on how can I solve this error in my code, but could not found anything related.
See I have a class called LButton and its constructor definition can’t find its declaration.

LButton.hpp

#ifndef LBUTTON_HPP
#define LBUTTON_HPP

#include "LTexture.hpp"

#include <SDL2/SDL.h>
#include <vector>

enum ButtonSpriteEvents{
    BUTTON_SPRITE_MOUSE_OUT,
    BUTTON_SPRITE_MOUSE_OVER_MOTION,
    BUTTON_SPRITE_MOUSE_DOWN,
    BUTTON_SPRITE_MOUSE_UP,
    BUTTON_SPRITE_MOUSE_TOTAL
};

class LButton{
    public:
        //Initializes internal variables
        LButton(LTexture&,std::vector<SDL_Rect>&&);
        //Sets top left position
        void set_position(int x,int y);
        //Handles mouse events
        void handle_event(SDL_Event* e);
        //Shows button sprite
        void render();
    private:
        SDL_Point position;
        std::vector<SDL_Rect>& sprites;
        LTexture& button_sprite_sheet_renderer;
        ButtonSpriteEvents current_button;
};
#endif

LButton.cpp

#include "LButton.hpp"

LButton::LButton(LTexture& renderer,std::vector<SDL_Rect>&& v)
    :position(SDL_Point{0,0}),sprites(std::move(v)),button_sprite_sheet_renderer(renderer)
{
   current_button = BUTTON_SPRITE_MOUSE_OUT;
}

This produces a compiler error which exactly states

‘out-of-line definition of ‘LButton’ does not match any declaration in ‘LButton’.

There is also a strange case on while typing my ‘sprites’ class variable it shows that the parameter is (int &) instead of (std::vector<SDL_Rect>&)

Source: Windows Questions C++

LEAVE A COMMENT