无法构建谷歌模拟
Couldn't build google mock
我尝试使用MinGW在Windows7上构建google mock。但我做不到。
我通过点击"下载Zip"按钮从下面的网站下载了谷歌测试和谷歌模拟。[https://github.com/google/googletest][1]
我解压缩了文件并在命令行上执行命令。
> g++ -c -Iinclude -I. src/gmock-all.cc
但是错误发生了。
> include/gmock/internal/gmock-port.h:53:45: fatal error: gtest/internal/gtest-linked_ptr.h: No such file or directory
我该如何解决?
您应该首先构建googletest,然后构建googlemock。它是捆绑的其中googlemock位于名为"gtest"的子目录中。这就是你需要做的:
g++ -isystem <path_to_gtest>/include -I<path_to_gtest>
-isystem <path_to_gmock>/include -I<path_to_gmock>
-pthread -c <path_to_gtest>/src/gtest-all.cc
g++ -isystem <path_to_gtest>/include -I<path_to_gtest>
-isystem <path_to_gmock>/include -I<path_to_gmock>
-pthread -c <path_to_gmock>/src/gmock-all.cc
这肯定会在Linux上工作,但我不能100%确定MinGW在如果没有帮助,我建议使用Visual Studio社区版。您已经在<path_to_gmock>/msvc/2010
中设置了VS解决方案。它是VS2010的解决方案,但使用较新版本打开它会提示您升级工具集。简单地接受并构建"gmock"项目solution.o_gmock>/src/gmock-all.cc
相关文章:
- 谷歌模拟和覆盖关键字
- 如何在谷歌模拟中匹配 C 样式数组
- 如何使用不同的谷歌模拟运行相同的谷歌测试用例?
- 在谷歌测试中创建模拟类的向量
- 谷歌模拟嘲笑非虚拟函数
- C++ 谷歌模拟/单元测试:模拟方法未调用,原始方法是
- 无法使用谷歌模拟模拟CDatabase打开功能
- 谷歌模拟如何在测试中使用模拟
- 谷歌模拟:嘲笑家长类?
- EXPECT_CALL在谷歌测试中没有模拟
- 为什么谷歌测试/模拟显示 std::unique_ptr 泄露的模拟对象错误?
- 谷歌模拟类似乎没有实现
- 如何测试基类中的方法是否已使用谷歌模拟调用和执行?
- 谷歌模拟分割错误与简单的EXPECT_CALL案例
- 设置谷歌模拟 1.6
- 谷歌模拟 - 怎么说"function must be called ONCE with a certain parameter but ok to be called many times with
- 谷歌模拟 - 保存EXPECT_CALL然后重复使用和更改子句
- 谷歌模拟 - 如何EXPECT_CALL变量名称,即标识符
- 谷歌模拟单例C++类
- 谷歌模拟EXPECT_CALL具有微小的行为变化