tanghong123 / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

How to use google test in vc6.0 IDE? #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. i use google test in vc6.0 ,it output many error.

What version of the product are you using? On what operating system?
i use gtest-1.2.1 in windowsXP.

Please provide any additional information below.
Compiling...
Test.cpp
d:\include\gtest\internal\gtest-port.h(662) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-port.h(663) : see reference to
class template instantiation 'testing::internal::bool_constant<bool_value>'
being compiled
d:\include\gtest\internal\gtest-port.h(662) : error C2252: 'value' : pure
specifier can only be specified for functions
        d:\include\gtest\internal\gtest-port.h(663) : see reference to
class template instantiation 'testing::internal::bool_constant<bool_value>'
being compiled
d:\include\gtest\internal\gtest-port.h(664) : error C2039: 'value' : is not
a member of 'bool_constant<bool_value>'
d:\include\gtest\internal\gtest-port.h(664) : error C2734: 'value' : const
object must be initialized if not extern
d:\include\gtest\internal\gtest-port.h(664) : error C2734: 'value' : const
object must be initialized if not extern
d:\include\gtest\internal\gtest-port.h(662) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-port.h(670) : see reference to
class template instantiation 'testing::internal::bool_constant<0>' being
compiled
        d:\include\gtest\internal\gtest-port.h(670) : see reference to
class template instantiation 'testing::internal::is_pointer<T>' being compiled
d:\include\gtest\internal\gtest-port.h(662) : error C2252: 'value' : pure
specifier can only be specified for functions
        d:\include\gtest\internal\gtest-port.h(670) : see reference to
class template instantiation 'testing::internal::bool_constant<0>' being
compiled
        d:\include\gtest\internal\gtest-port.h(670) : see reference to
class template instantiation 'testing::internal::is_pointer<T>' being compiled
d:\include\gtest\internal\gtest-port.h(673) : error C2989:
'is_pointer<class ?? ::T *>' : template class has already been defined as a
non-template class
d:\include\gtest\internal\gtest-port.h(673) : error C2988: unrecognizable
template declaration/definition
d:\include\gtest\internal\gtest-internal.h(347) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(347) : error C2252: 'kBitCount'
: pure specifier can only be specified for functions
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(351) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(351) : error C2252:
'kFractionBitCount' : pure specifier can only be specified for functions
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(354) : error C2065: 'kBitCount'
: undeclared identifier
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(354) : error C2065:
'kFractionBitCount' : undeclared identifier
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(354) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(354) : error C2252:
'kExponentBitCount' : pure specifier can only be specified for functions
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(357) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(357) : error C2252:
'kSignBitMask' : pure specifier can only be specified for functions
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(361) : error C2065:
'kExponentBitCount' : undeclared identifier
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(361) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(361) : error C2252:
'kFractionBitMask' : pure specifier can only be specified for functions
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(364) : error C2065:
'kSignBitMask' : undeclared identifier
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(364) : error C2065:
'kFractionBitMask' : undeclared identifier
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(364) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(364) : error C2252:
'kExponentBitMask' : pure specifier can only be specified for functions
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(378) : error C2258: illegal pure
syntax, must be '= 0'
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
d:\include\gtest\internal\gtest-internal.h(378) : error C2252: 'kMaxUlps' :
pure specifier can only be specified for functions
        d:\include\gtest\internal\gtest-internal.h(478) : see reference to
class template instantiation 'testing::internal::FloatingPoint<RawType>'
being compiled
Error executing cl.exe.

Test.exe - 28 error(s), 0 warning(s)

Original issue reported on code.google.com by zhaobiny...@gmail.com on 19 Feb 2009 at 7:18

GoogleCodeExporter commented 9 years ago
Unfortunately VC 6 is a very old compiler and has many bugs.  It lacks support 
for
many standard C++ features.  Therefore currently we don't have plan to support 
it. 
You are welcome to port google test to VC 6 yourself if you are interested.

Original comment by zhanyong...@gmail.com on 19 Feb 2009 at 8:44

GoogleCodeExporter commented 9 years ago
Hi, I'm currently porting to VC6.

Try attached version(my personal build) if you are interested. VC6.dsp is a 
sample test program. Quite tiny, 
but it does compile and work.

It seems difficult for me to port perfectly, because VC6 provide quite poor 
support for C++ standard as Wan 
said, especially template which heavily used in gtest. But I will keep trying.

Currently, 287/292 test in gtest_unittest.cc(Tests for google test) passed.

Original comment by kyossi...@gmail.com on 2 Apr 2009 at 2:11

Attachments: