我想使用(編譯)谷歌測試,但有麻煩。谷歌測試 - undefined rerefence當使用2個不同的項目
我有1個exe項目和另一個項目(谷歌單元測試),其中有一些類的第一個項目的測試。
我試圖使用從信息: C++ unit test start guide, how to set up Google Test
我有2個C++在我的工作區項目:
Exe項目名稱:測試儀
- src文件夾包含CElement.cpp,CElement.h,Main.cpp
谷歌測試項目(EXE)名稱:GoogleTestTester
- gtest_src文件夾(包含GTEST)
- TestElement文件夾(包含我的測試類)
- Test1.cpp:
測試( MyAppTtests,name) CElement * pElm = new CElement();
//..
}
我收到鏈接錯誤(在GoogleTestTester項目):以CElement未定義參考:: CElement()
- 我已經包括「CElement。 h「in Test1.cpp
- 在項目屬性中,我包含TestElement文件夾的路徑(其中包含CElement.h文件)
我該如何解決?
[如何用Google測試測試EXE?](http://stackoverflow.com/questions/23088252/how-to-test-an-exe-with-google-test)可能有重複 –