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! :)
Asked
Active
Viewed 313 times
0
1 Answers
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
-
You just saved me. Thanks a lot :) – AlinP25 Apr 12 '16 at 07:53