2

当我在 Redhat OS(gcc 版本为 3.2.2)上编译 gtest 示例时,它会抛出如下错误,但是它在 Ubuntu 上编译它没关系。请帮助我。错误或警告:

../include/gtest/internal/gtest-internal.h: In instantiation of `testing::internal::ImplicitlyConvertible<const void*, const void*>':
../include/gtest/gtest-printers.h:314:   instantiated from `void testing::internal::DefaultPrintTo(char, testing::internal::bool_constant<true>, T*, std::ostream*) [with T = const void]'
../include/gtest/gtest-printers.h:376:   instantiated from `void testing::internal::PrintTo(const T&, std::ostream*) [with T = const void*]'
../include/gtest/gtest-printers.h:416:   instantiated from here
../include/gtest/internal/gtest-internal.h:890: no method `
   testing::internal::ImplicitlyConvertible<const void*, const void*>::MakeFrom
   '
../include/gtest/internal/gtest-internal.h:890: invalid use of undefined type `
   class testing::internal::ImplicitlyConvertible<const void*, const void*>'
../include/gtest/internal/gtest-internal.h:847: declaration of `class 
   testing::internal::ImplicitlyConvertible<const void*, const void*>'
4

1 回答 1

2

GCC 3.2 是一个太旧的编译器,无法支持 Google Test 使用的结构——它甚至早于 C++ 03 标准。尝试使用较新版本的 GCC 构建这些示例。

于 2013-03-14T15:24:19.827 回答