TickBaby / googlemock

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

make check fails with "cannot use typeid with -fno-rtti" #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Just running "make" compiles cleanly

make check fails with dozens of messages similar to this:

g++ -DHAVE_CONFIG_H -I. -I./build-aux  -I/myHome/localInstall-64/include
-I/myHome/localInstall-64/include -I./include
-I/myHome/localInstall-64/include  -fno-rtti -DGTEST_HAS_RTTI=0 -g -O2 -MT
test/test_gmock_no_rtti_test-gmock-spec-builders_test.o -MD -MP -MF
test/.deps/test_gmock_no_rtti_test-gmock-spec-builders_test.Tpo -c -o
test/test_gmock_no_rtti_test-gmock-spec-builders_test.o `test -f
'test/gmock-spec-builders_test.cc' || echo
'./'`test/gmock-spec-builders_test.cc
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal:
In static member function 'static bool
std::tr1::_Function_base::_Base_manager<_Functor>::_M_manager(std::tr1::_Any_dat
a&,
const std::tr1::_Any_data&, std::tr1::_Manager_operation)':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal:904:
error: cannot use typeid with -fno-rtti
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal:
In static member function 'static bool
std::tr1::_Function_base::_Ref_manager<_Functor>::_M_manager(std::tr1::_Any_data
&,
const std::tr1::_Any_data&, std::tr1::_Manager_operation)':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal:982:
error: cannot use typeid with -fno-rtti
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal_iterate.h:
In static member function 'static bool std::tr1::_Function_handler<void
()(), _Member _Class::*>::_M_manager(std::tr1::_Any_data&, const
std::tr1::_Any_data&, std::tr1::_Manager_operation)':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal_iterate.h:572:
error: cannot use typeid with -fno-rtti
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal_iterate.h:
In member function 'const std::type_info& std::tr1::function<_Res
()()>::target_type() const':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functio
nal_iterate.h:883:
error: cannot use typeid with -fno-rtti

Additional info:
I'm building google mock from SVN trunk

$ uname -a
Linux myHostname 2.6.18-53.1.13.el5 #1 SMP Mon Feb 11 13:27:27 EST 2008
x86_64 x86_64 x86_64 GNU/Linux

$ gcc -v 
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

Configure command:
LDFLAGS="-L/myHome/localInstall-64/lib"
CPPFLAGS="-I/myHome/localInstall-64/include" ./configure
--prefix=/myHome/localInstall-64 --with-gtest=/myHome/localInstall-64/

Original issue reported on code.google.com by thomas.j...@gmail.com on 17 Jul 2009 at 6:28

GoogleCodeExporter commented 9 years ago
This is a bug in gcc's tr1 library.

A bypass was already implemented in gmock.  Which revision are you using?  Can 
you
try the head revision?  Thanks.

Original comment by zhanyong...@gmail.com on 4 Aug 2009 at 4:29

GoogleCodeExporter commented 9 years ago
This is fixed in the trunk already.

Original comment by zhanyong...@gmail.com on 4 Sep 2009 at 9:01