首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >googletest -在CentOS上制作示例项目错误

googletest -在CentOS上制作示例项目错误
EN

Stack Overflow用户
提问于 2021-09-04 13:50:28
回答 1查看 715关注 0票数 0

我想测试建立googletest的基本例子,但是我失败了.

步骤

代码语言:javascript
复制
$ 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

代码语言:javascript
复制
$ 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

任何建议都是非常有用的!

EN

回答 1

Stack Overflow用户

发布于 2021-09-05 23:47:08

构建googletest基本示例

例如,CentOS 7.9

代码语言:javascript
复制
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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69055923

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档