Hey guys, I'm struggling with these problems
I got a lot of unresolved external errors
1>game.obj : error LNK2019: unresolved external symbol "public: __thiscall Player::Player(void)" (??0Player@@QAE@XZ) referenced in function "public: __thiscall Game::Game(void)" (??0Game@@QAE@XZ)
1>game.obj : error LNK2019: unresolved external symbol "public: __thiscall Player::Player(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Player@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: void __thiscall Game::newMonster(void)" (?newMonster@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Player::gameOver(void)" (?gameOver@Player@@QAE_NXZ) referenced in function "public: void __thiscall Game::defaultMenu(void)" (?defaultMenu@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: void __thiscall Player::updatePet(int,class Pet *)" (?updatePet@Player@@QAEXHPAVPet@@@Z) referenced in function "public: void __thiscall Game::inGameMenu(void)" (?inGameMenu@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Player::enemyName(void)" (?enemyName@Player@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: void __thiscall Game::inGameMenu(void)" (?inGameMenu@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: class Pet * __thiscall Player::getMonster(int)" (?getMonster@Player@@QAEPAVPet@@H@Z) referenced in function "public: void __thiscall Game::inGameMenu(void)" (?inGameMenu@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: int __thiscall Player::getMonsterSize(void)" (?getMonsterSize@Player@@QAEHXZ) referenced in function "public: void __thiscall Game::inGameMenu(void)" (?inGameMenu@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Player::getName(void)" (?getName@Player@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: void __thiscall Game::saveMonster(void)" (?saveMonster@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: void __thiscall Player::addMonster(class Pet *)" (?addMonster@Player@@QAEXPAVPet@@@Z) referenced in function "public: void __thiscall Game::loadMonster(void)" (?loadMonster@Game@@QAEXXZ)
1>game.obj : error LNK2019: unresolved external symbol "public: void __thiscall Player::setName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?setName@Player@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: void __thiscall Game::loadMonster(void)" (?loadMonster@Game@@QAEXXZ)
1>fatal error LNK1120: 10 unresolved externals
The thing is, these errors didn't show up last couple days ago and it just appeared suddenly out of nowhere.
Can anyone help me here?
cheers,
Looks like your Player.cpp is not in to-compile list. Did you recently move stuff from header to a cpp file?
No, I didn't change anything at all which is why this is really weird
Check your project settings. And if you can edit file where all that functions located. On a side note: What IDE do you use?
I'm using visual studio 2010. Can you explain more about the project settings?