【发布时间】:2020-01-21 05:59:23
【问题描述】:
我正在使用 google test c++ framwork 来测试我的项目,但遇到一些问题供您参考,请参阅以下编译错误。
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> >’
【问题讨论】:
-
请以正确的格式发布日志以提高可读性。
-
GCC 4.5 已经很老了。您是否考虑过使用更新的编译器?然后您就可以享受对 C++11/14/17 的支持,而您当前的编译器太旧而无法支持。
-
@VaibhavSharma OP 将无法正确格式化(即作为代码),因为系统会告诉他们他们需要用这么多代码提供更多的散文解释。
-
你至少需要 gcc 4.6 stackoverflow.com/questions/3756473/…
标签: c++ linux googletest gcc4