I'm trying to use (compile) google test, but having troubles.
I have 1 exe project and another project (google unit test) which have tests for some classes of the first project.
I have tried to use the info from: C++ unit test start guide, how to set up Google Test
I have 2 c++ projects in my workspace:
Exe project name: Tester
- src folder which contains CElement.cpp, CElement.h, Main.cpp
Google test project (exe) name: GoogleTestTester
- gtest_src folder (contains the gtest)
- TestElement folder (contains my tests classes)
- Test1.cpp:
Test(MyAppTtests, name) { CElement* pElm = new CElement();
//..
}
I'm getting link error (in the GoogleTestTester project): undefined reference to CElement::CElement()
- I have include of "CElement.h" in Test1.cpp
- In the project properties I have include path to the TestElement folder (which contains CElement.h file)
How can I fix it ?