2013-05-11 70 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

相关问题