私はゲームを複数のファイルに分割しようとしました。これらのエラーが表示されます。C++リンカエラー
1>item.obj : error LNK2005: "private: static class sf::Image ctile::itile" ([email protected]@@[email protected]@@A) already defined in character.obj
1>item.obj : error LNK2005: "class cmap maps" ([email protected]@[email protected]@A) already defined in character.obj
1>item.obj : error LNK2005: "class cmainchar mainch" ([email protected]@[email protected]@A) already defined in character.obj
1>item.obj : error LNK2005: "class citemmanager itemmanager" ([email protected]@[email protected]@A) already defined in character.obj
1>item.obj : error LNK2005: "private: static class sf::Image citem::iitem" ([email protected]@@[email protected]@@A) already defined in character.obj
1>item.obj : error LNK2005: "private: static class sf::Image cspell::ispell" ([email protected]@@[email protected]@@A) already defined in character.obj
1>item.obj : error LNK2005: "class sf::RenderWindow App" ([email protected]@[email protected]@@A) already defined in character.obj
1>item.obj : error LNK2005: "class sf::View View" ([email protected]@[email protected]@A) already defined in character.obj
1>main.obj : error LNK2005: "private: static class sf::Image ctile::itile" ([email protected]@@[email protected]@@A) already defined in character.obj
1>main.obj : error LNK2005: "class cmap maps" ([email protected]@[email protected]@A) already defined in character.obj
1>main.obj : error LNK2005: "class cmainchar mainch" ([email protected]@[email protected]@A) already defined in character.obj
1>main.obj : error LNK2005: "class citemmanager itemmanager" ([email protected]@[email protected]@A) already defined in character.obj
1>main.obj : error LNK2005: "private: static class sf::Image citem::iitem" ([email protected]@@[email protected]@@A) already defined in character.obj
1>main.obj : error LNK2005: "private: static class sf::Image cspell::ispell" ([email protected]@@[email protected]@@A) already defined in character.obj
1>main.obj : error LNK2005: "class sf::RenderWindow App" ([email protected]@[email protected]@@A) already defined in character.obj
1>main.obj : error LNK2005: "class sf::View View" ([email protected]@[email protected]@A) already defined in character.obj
1>map.obj : error LNK2005: "private: static class sf::Image ctile::itile" ([email protected]@@[email protected]@@A) already defined in character.obj
1>map.obj : error LNK2005: "class cmap maps" ([email protected]@[email protected]@A) already defined in character.obj
1>map.obj : error LNK2005: "class cmainchar mainch" ([email protected]@[email protected]@A) already defined in character.obj
1>map.obj : error LNK2005: "class citemmanager itemmanager" ([email protected]@[email protected]@A) already defined in character.obj
1>map.obj : error LNK2005: "private: static class sf::Image citem::iitem" ([email protected]@@[email protected]@@A) already defined in character.obj
1>map.obj : error LNK2005: "private: static class sf::Image cspell::ispell" ([email protected]@@[email protected]@@A) already defined in character.obj
1>map.obj : error LNK2005: "class sf::RenderWindow App" ([email protected]@[email protected]@@A) already defined in character.obj
1>map.obj : error LNK2005: "class sf::View View" ([email protected]@[email protected]@A) already defined in character.obj
1>spell.obj : error LNK2005: "private: static class sf::Image ctile::itile" ([email protected]@@[email protected]@@A) already defined in character.obj
1>spell.obj : error LNK2005: "class cmap maps" ([email protected]@[email protected]@A) already defined in character.obj
1>spell.obj : error LNK2005: "class cmainchar mainch" ([email protected]@[email protected]@A) already defined in character.obj
1>spell.obj : error LNK2005: "class citemmanager itemmanager" ([email protected]@[email protected]@A) already defined in character.obj
1>spell.obj : error LNK2005: "private: static class sf::Image citem::iitem" ([email protected]@@[email protected]@@A) already defined in character.obj
1>spell.obj : error LNK2005: "private: static class sf::Image cspell::ispell" ([email protected]@@[email protected]@@A) already defined in character.obj
1>spell.obj : error LNK2005: "class sf::RenderWindow App" ([email protected]@[email protected]@@A) already defined in character.obj
1>spell.obj : error LNK2005: "class sf::View View" ([email protected]@[email protected]@A) already defined in character.obj
*あなたのゲーム*で始めるのではなく、単純な "hello world"スタイルのアプリケーションを2つ以上のファイルに分割することをお勧めします。そうすれば、(a)ここにコードを掲載し、(b)重要な概念をより簡単に理解することができます。エラーメッセージの一覧だけでコードをデバッグすることはできません。 –