我正在尝试为我的项目编译和使用 Google 测试。 我已经使用成功创建了 .sln 和 .vcproj 文件 制作。 .sln 文件的编译也成功了。 但是,当我尝试按照指出的步骤操作时 在“nonsensical101”-s 中的回答如下: How to setup Google C++ Testing Framework (gtest) on Visual Studio 2005 我发现我的电脑上根本没有"gtestd.lib"。 为什么??? 这也是我在尝试编译示例时遇到的错误 程序。
错误:
Error 1 error LNK1104: cannot open file 'gtestd.lib' C:\Documents and Settings\User\my documents\visual studio 2010\Projects\String_GTest\String_GTest\LINK
附言。我正在使用 Visual Studio 10。
最佳答案
Google 的 C++ 测试框架有两个输出库:一个是 gtest.lib,另一个是 gtest_main.lib。根据 Nik Reiman 在 How to setup Google C++ Testing Framework (gtest) on Visual Studio 2005 上的回答,如果你没有这些,说明你没有编译成功...
关于c++ - 编译/使用谷歌测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15808500/