我想测试建立googletest的基本例子,但是我失败了.
步骤
$ cd ~/Test/
$ git clone https://github.com/google/googletest
$ cd googletest ---> It's the first dir
$ mkdir mybuild
$ cd mybuild
$ cmake -Dgtest_build_samples=ON .. ---> One warning -配置已完成
-生成已完成
CMake警告:
项目没有使用手动指定的变量:
gTest_build_samples
-构建文件已写入/home/hughesyang/Test/googletest/mybuild
$ make ---> error occur!错误消息(代码片段前17行):
-配置已完成
-生成已完成
-构建文件已写入: /home/hughesyang/Test/googletest/mybuild
3%构建CXX对象googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
包含在/home/hughesyang/Test/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h:38:0,的文件中
来自/home/hughesyang/Test/googletest/googletest/include/gtest/gtest-death-test.h:40,
来自/home/hughesyang/Test/googletest/googletest/include/gtest/gtest.h:62,
来自/home/hughesyang/Test/googletest/googletest/src/gtest-all.cc:38:
静态成员函数中的/home/hughesyang/Test/googletest/googletest/include/gtest/gtest-matchers.h:‘测试::In::MatcherBase::IsInlined()’:
/home/hughesyang/Test/googletest/googletest/include/gtest/gtest-matchers.h:414:12:错误:‘is_trivially_copy_constructible’不是‘std’std::is_trivially_copy_constructible::value &&
^ /home/hughesyang/Test/googletest/googletest/include/gtest/gtest-matchers.h:414:50:错误:预期的“令牌std::is_trivially_copy_constructible::value &&”之前的主表达式
^ /home/hughesyang/Test/googletest/googletest/include/gtest/gtest-matchers.h:414:51:错误:‘::value’尚未声明为std::is_trivially_copy_constructible::value &&
..。
环境
操作系统: CentOS 7.7
CMake ver: 3.21.2
GNU ver: 4.2.1
gcc维尔: 9.3.1-2
任何建议都是非常有用的!
发布于 2021-09-05 23:47:08
构建googletest基本示例
例如,CentOS 7.9
git clone https://github.com/google/googletest.git
cd googletest/ && mkdir build && cd build/
CC=gcc84 CXX=g++84 cmake3 -Dgtest_build_samples=ON ..
## cmake3 (epel) is version 3.12.2-1.el7
make ## no errors, the 10 samples are present in googletest/build/googletest/gcc84,g++84:项目9→how to install gcc 4.9.2 on RHEL 7.4
https://stackoverflow.com/questions/69055923
复制相似问题