I'm using Google Test Framework to set some unit tests. I have got three projects in my solution:
- FN (my project)
- FN_test (my tests)
- gtest (Google Test Framework)
I set FN_test to have FN and gtest as references (dependencies), and then I think I'm ready to set up my tests (I've already set everyone to /MTd (not doing this was leading me to linking errors before)).
Particularly, I define a class called Embark in FN I would like to test using FN_test. So far, so good. Thus I write a classe called EmbarkTest using googletest, declare a member Embark* and write inside the constructor:
EmbarkTest() {
e = new Embark(900,2010);
}
Then , F7 pressed, I get the following:
1>FN_test.obj : error LNK2019: unresolved external symbol "public: __thiscall Embark::Embark(int,int)" (??0Embark@@QAE@HH@Z) referenced in function "protected: __thiscall EmbarkTest::EmbarkTest(void)" (??0EmbarkTest@@IAE@XZ)
1>D:\Users\lg\Product\code\FN\Debug\FN_test.exe : fatal error LNK1120: 1 unresolved externals
Does someone know what have I done wrong and/or what can I do to settle this?
EDIT: Relevant code from Embark.h
class Embark
{
public:
//Constructor for initial state
Embark(int _id, int _year);
//Destructor
~Embark();
/* ... */
}