1

C++ アプリケーションをビルドしようとすると、多くの未解決の外部エラーが発生します。

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

問題は、これらのエラーが数日前に表示されなかったということです。彼らはどこからともなく突然現れました。

また、Player.cpp と Game.cpp の必要な場所に Player.h を含めました。

誰でもここで私を助けることができますか?

4

0 に答える 0