2013-05-11 99 views
0

我構建了Google測試項目。無法構建使用Google測試的測試項目

我增加了包括在目錄General -> Addition Include Directories.
我添加庫目錄到Linker -> Additional Library directories
我加入gtest_maind.lib和gtestd.lib到Linker -> Input -> Additional Dependencies

我隨後在另一條鏈的指令來改變Code Generation -> Runtime Library to Multi-threaded Debug (/MTd)

注:我使用Visual Studio 2010

在儘管做了上述所有我仍然得到以下鏈接錯誤

Error 1 error LNK2019: unresolved external symbol "public: __thiscall 
Utility::~Utility(void)" ([email protected]@[email protected]) referenced in function "private: virtual 
void __thiscall UtiltyTest_test1_Test::TestBody(void)" (? 
[email protected][email protected]@EAEXXZ) C:\Users\<username>\Documents\Visual Studio 
2010\Projects\Calc\CalTest\UtilityTest.obj 

我在這裏丟失的東西。有人可以幫我解決這個錯誤。

回答

0

你想測試任何.c文件嗎? 因爲如果你是你應該試試這個:

#ifdef __cplusplus 
    extern "C" { 
#endif 
    void cFunctionCalledFromCppFile(); 
#ifdef __cplusplus 
    } 
#endif 
+0

不,我只使用.cpp文件 – 2013-05-13 15:44:29

相關問題