Problem solved! thanx guys. i can't believe i made such as dumb mistake
Hello cplusplus forums. i am having a problem with this code. i am getting these two errors:
1>testProgram.obj : error LNK2019: unresolved external symbol "public: int __thiscall die::getNum(void)const " (?getNum@die@@QBEHXZ) referenced in function _main
1>testProgram.obj : error LNK2019: unresolved external symbol "public: __thiscall die::die(void)" (??0die@@QAE@XZ) referenced in function _main
1>c:\users\garry\documents\visual studio 2010\Projects\testProgram\Debug\testProgram.exe : fatal error LNK1120: 2 unresolved externals
i just wanted to test separating classes from the main file and i did exactly what my textbook did, but i seem to keep on getting these errors. i have searched the forums the suggestions didn't seem to really help. also i am using visual studio 2010.
here is my code:
die.h
1 2 3 4 5 6 7 8 9
class die
{
public:
die();
int roll();
int getNum() const;
private:
int num;
};