2013-03-14 55 views
2

當我在Redhat OS上編譯gtest示例(gcc版本是3.2.2)時,它會拋出下面的錯誤,但是它在Ubuntu上編譯好了.Pleae幫助我。 錯誤或警告:gtest:編譯錯誤

../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*>' 
+0

你在ubuntu和redhat上使用哪些版本的編譯器? – phs 2013-03-14 05:50:32

回答

2

GCC 3.2編譯器這簡直太舊,以支持構建,谷歌測試使用 - 它甚至早於C++ 03的標準。嘗試用較新版本的GCC構建這些示例。

+0

那麼,[README](https://code.google.com/p/googletest/source/browse/tags/release-1.6.0/README?r=638)需要「A C++ 98-standard-兼容編譯器「。但是gcc 3.2.3對於我來說同樣的錯誤失敗了。 – 2014-12-04 18:30:37

+0

關於與3.2.3一起使用的替代框架的任何想法? – 2014-12-04 18:32:52