0

I'm trying to recreate a game (copy of Pong), using a tutorial (I'm learning SFML atm). After I got the menu and the SplashScreen working, I started to implement the player, when I get the error
'LNK2001 - unresolved external symbol "private: static class PlayerPaddle Game::_player1" (?_player1@Game@@0VPlayerPaddle@@A)'.
I tried everything came to my mind, i searched on Google, asked some friends, and I still can't get it done. Here is the whole code: https://github.com/AlinP25/Pang-Tut . What is the problem and how can I solve it? I'm desperate. Thanks a lot! :)

deeiip
  • 3,319
  • 2
  • 22
  • 33
AlinP25
  • 95
  • 1
  • 11

1 Answers1

3

You forgot to instantiate _player1 in Game.cpp. Do it at the end next to _mainWindow and _gameState:

PlayerPaddle Game::_player1;
piwi
  • 5,136
  • 2
  • 24
  • 48