compilation - 安装gtest的问题,由于巨大的错误无法编译
问题描述
make 时会发生大量编译错误。
我所做的逐项列出:我的操作逐项显示:
yum install git
yum install gcc-c++
yum install cmake
yum install python
yum install zeromq-devel
然后: git clone https://github.com/google/googletest.git
cd /googletest/googletest
[root@VM_16_11_centos googletest]# cmake CMakeLists.txt
-- Configuring done
-- Generating done
-- Build files have been written to:
/usr/local/qiuxin/googletest/googletest
`[root@VM_16_11_centos googletest]# make
Huge Error here!!!
In file included from
/usr/local/qiuxin/googletest/googletest/src/gtest-all.cc:38:0:
/usr/local/qiuxin/googletest/googletest/include/gtest/gtest.h: In
member function 'virtual
testing::Test::Setup_should_be_spelled_SetUp*
testing::Test::Setup()':
解决方案
解决了。我犯的错误是: 1) 我在 googletest/googletest 目录下创建了一个 build 文件夹。
正确的操作应该是:
在 googletest 目录(不是 googletest/googletest 目录)中创建一个构建文件夹。然后: cd build cmake .. -DBUILD_GTEST=ON -DBUILD_SHARED_LIBS=ON make sudo make install 一切顺利!
推荐阅读
- javascript - JavaScript:切换非布尔值的简写
- python - 我的仪表板程序中的“IncorrectTypeException”
- python - 排除具有空值的 Python 列表
- javascript - 将 tr::before 数字与表格混合?
- swift - SwiftUI - 使用 CoreData 保存图像
- python - numpy.float64' 对象不可调用 - 超参数调整
- html - 如何使用 Vue 的 String 和后端数据显示图像?
- sql - 从登录时间和注销时间为不同行的表中计算持续时间
- google-apps-script - 在基于应用程序脚本的邮件合并中附加多个文件(动态和静态)
- c++ - 将原始指针与其拥有的 shared_ptr 一起缓存以获得更好的访问性能是一个好主意吗?