c++ - c+ # - 在gcc 4.5.2编译器上,有没有办法使用google测试工具?

我使用google test c freamwork来测试项目,但是面对一些问题,编译错误如下所示。


src/exclusions/Gtest/../../include/gtest/internal/gtest-port.h:972:37: error: ‘nullptr’ was not declared in this scope


src/exclusions/Gtest/../../include/gtest/internal/gtest-port.h:1316:22: error: expected ‘;’ before ‘override’


src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:307:37: error: ‘testing::internal::MatcherBase<T>::MatcherBase(const testing::internal::MatcherBase<T>&)’ declared with non-public access cannot be defaulted in the class body


/home/buildserver/rswork25Nov/Dev-UEM-1.2-POC/src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:308:48: error: ‘testing::internal::MatcherBase<T>& testing::internal::MatcherBase<T>::operator=(const testing::internal::MatcherBase<T>&)’ declared with non-public access cannot be defaulted in the class body


src/exclusions/Gtest/../../include/gtest/internal/gtest-param-util.h:521:74: error: there are no arguments to ‘InstantiationInfo’ that depend on a template parameter, so a declaration of ‘InstantiationInfo’ must be available


src/exclusions/Gtest/../../include/gtest/internal/../gtest-matchers.h:305:61: error: cannot allocate an object of abstract type ‘testing::internal::MatcherInterfaceAdapter<std::basic_string<char> >’



时间: 原作者:

也许你可以使用旧标签googletest

比较1.8.1要求:


Linux Requirements



These are the base requirements to build and use Google Test from a source package (as described below):



GNU-compatible Make or gmake


POSIX-standard shell


POSIX(-2) Regular Expressions (regex.h)


A C++98-standard-compliant compiler



使用最新的:


Build Requirements



These are the base requirements to build and use Google Test from a source package:



Bazel or CMake. NOTE: Bazel is the build system that googletest is using internally and tests against. CMake is community-supported.



a C++11-standard-compliant compiler



我想你得权衡一下:googletest工具链的兼容性。

原作者:
...