tr00per / googletest

Automatically exported from code.google.com/p/googletest
0 stars 0 forks source link

Linking error on AIX #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compilation of unit tests
2.
3.

What is the expected output? What do you see instead?
During linking the following error occurred.
$ make check
...
g++ -g -O2 -o samples/.libs/sample1_unittest samples/sample1_unittest.o 
-L/home/emst/gtest-1.0.1/lib/.libs -Llib/.libs -lgtest_main -lgtest
-L/home/mape/downloads/gcc-3.4.4/powerpc-ibm-aix5.2.0.0/libstdc++-v3/src
-L/home/mape/downloads/gcc-3.4.4/powerpc-ibm-aix5.2.0.0/libstdc++-v3/src/.libs
-L/home/mape/downloads/gcc-3.4.4/gcc -L/usr/local/lib
samples/.libs/libsamples.a
-Wl,-blibpath:/usr/local//lib:/usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.4:/u
sr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.4/../../..:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: typeinfo for testing::Test
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
make[1]: *** [samples/sample1_unittest] Fel 1
make[1]: Leaving directory `/home/emst/gtest-1.0.1'
make: *** [check-am] Fel 2

What version of the product are you using? On what operating system?
gtest-1.0.1

[emst@aix1 gtest-1.0.1]$ uname -a
AIX aix1 2 5 0056687F4C00

[emst@aix1 gtest-1.0.1]$ gcc --version
gcc (GCC) 3.4.4
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Please provide any additional information below.
From my understanding this is related to virtual functions and some entries
in the vnode table not being generated due to non implemented virtual
functions. But we tried to add an empty body to all virtual functions in
testing::Test but it didn't make a difference.

We later found a workaround that is to compile the unit tests with the flag
-fno-rtti for GCC. After that the linking goes fine and the tests can be run.

Original issue reported on code.google.com by ema...@gmail.com on 27 Aug 2008 at 7:05

GoogleCodeExporter commented 9 years ago
Thanks for the report.

Unfortunately we don't have access to AIX machine to try this, nor do we have 
time to
investigate it now, given that there are many higher-priority work items in the 
queue
already.

-fno-rtti probably is not a good fix, as some new features in the head revision 
won't
work with it.

I'm gonna close the issue for now.  If you find a fix and want to contribute 
it, we
would greatly appreciate it.  In that case please see the instructions on
http://code.google.com/p/googletest/wiki/GoogleTestDevGuide.  Thanks.

Original comment by shiq...@gmail.com on 8 Sep 2008 at 11:27