Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: function (declared implicitly) cannot be referenced -- it is a deleted function  (Read 6594 times)

0 Members and 3 Guests are viewing this topic.

aSpookyMan

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Quote
class UIManager
   {
   public:
      RenderWindow window;
      Event event;

      UIManager( const RenderWindow& win, const Event& e) : window(win), event(e)
      {
         
      }
   };
The code above is giving me an error "sf::RenderWindow::RenderWindow(const sf::RenderWindow &)"
when I set window = win. Is this happening because I have not yet defined window? And if so how can I fix this? I had thought about making a global RenderWindow variable, but from what I've read that's not optimal.

I need help!

aSpookyMan

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
I just realized I didn't type out the error lol. Sorry about that

function "sf::RenderWindow(const sf::RenderWindow &)"(declared implicitly) cannot be referenced -- it is a deleted function

aSpookyMan

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
I got the error fixed with the help of a dude on discord. I just had to remove const and set the RenderWindow variable as a reference, pretty simple mistake.