I'm getting errors saying that my classes are already defined in other functions. I had previously made a program similar to this but I don't have and I cant find anywhere on the web on how I previously did it. I believe I linked my classes by like having said function for instance...
void getDungeon(Monster &Elites)
but i dont quite remember everything on how to do it...
anyways if it helps heres my error messages and some functions.
Let me know if you need more... I appreciate any help.
1 2 3 4 5 6 7 8
1>Fight.obj : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Enemy::getName(void)" (?getName@Enemy@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) already defined in Enemy.obj
1>Fight.obj : error LNK2005: "public: void __thiscall Enemy::setName(void)" (?setName@Enemy@@QAEXXZ) already defined in Enemy.obj
1>Fight.obj : error LNK2005: "public: double __thiscall Enemy::getCurrentHP(void)" (?getCurrentHP@Enemy@@QAENXZ) already defined in Enemy.obj
1>Fight.obj : error LNK2005: "public: void __thiscall Enemy::setCurrentHP(double)" (?setCurrentHP@Enemy@@QAEXN@Z) already defined in Enemy.obj
1>Fight.obj : error LNK2005: "public: double __thiscall Enemy::getMaxHP(void)" (?getMaxHP@Enemy@@QAENXZ) already defined in Enemy.obj
1>Fight.obj : error LNK2005: "public: void __thiscall Enemy::setMaxHP(double)" (?setMaxHP@Enemy@@QAEXN@Z) already defined in Enemy.obj
1>Fight.obj : error LNK2005: "public: double __thiscall Enemy::getStrength(void)" (?getStrength@Enemy@@QAENXZ) already defined in Enemy.obj
1>Fight.obj : error LNK2005: "public: void __thiscall Enemy::setStrength(double)" (?setStrength@Enemy@@QAEXN@Z) already defined in Enemy.obj
I have a feeling you're defining your member functions in a header..
Anyway, how is the code you posted relevant? Post the code where you declare and define Enemy class instead.