undefined reference to `ios virtual table' on i686 with -O option

Michael Anthony Riepe riepe@zip.eecs.umich.edu
Fri Sep 4 08:48:00 GMT 1998


Howdy,

I believe that I've come across an optimization bug in egcs g++ 1.1 on
the Lunux-i686 platform.  When compiled with -O (and -O2, -O3) I get a
bunch of undefined references to the 'ios virtual table'.  When
optimization is turned off the code compiles without any problems.  I am
able to compile OK on the solaris platform with and without -O.  I am
also able to compile OK using egcs 1.0.1, but not with 1.0.3 (I haven't
tried 1.0.2).  So the problem seems to be platform specific to the i686,
it only occurs with optimization turned on, and it appears to have been
introduced after the 1.0.1 release.

Here are some sample messages:

../Parse/magic/libmagic.a(magic_parser.o): In function
`magic_parser::parse(vector<char *, __default_alloc_template<true, 0> >
*)':
/nfs/srvrdsk1/t/Install/i686/Linux/include/g++/iostream.h:122: undefined
reference to `istream::ios virtual table'
../Parse/magic/libmagic.a(magic_parser.o): In function
`magic_parser::parse(vector<char *, __default_alloc_template<true, 0> >
*)':
/nfs/srvrdsk1/t/Install/i686/Linux/include/g++/fstream.h:65: undefined
reference to `ifstream::ios virtual table'
../Parse/tech/libtech.a(tech_parser.o): In function `rb_tree<char *,
pair<char *const, int>, select1st<pair<char *const, int> >, ltstr,
__default_alloc_template<true, 0> >::insert_unique(pair<char *const,
int> const &)':
/nfs/srvrdsk1/t/Install/i686/Linux/include/g++/stl_tree.h(.text+0x58):
undefined reference to `ios virtual table'

(note that in the last example, the error is not even in my code, but in
the rb_tree STL code.)

Any help would be appreciated!  Please Cc me directly by email as I
don't subscribe to the bugs mailing list.  Thanks.

--mike

-- 
+----------------------------------------------------------------+
|  Michael A. Riepe                    | Fill what's empty       |
|  Advanced Computer Architecture Lab  | Empty what's full       |
|  University of Michigan              |                -as      |
|  riepe@eecs.umich.edu                |                         |
|  http://www.eecs.umich.edu/~riepe    |                         |
+----------------------------------------------------------------+



More information about the Gcc-bugs mailing list