This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

confusing diagnostics


This (syntactically wrong) code gives rather confusing error reports:

class foo {
  int fudge;
  public:
  foo(int x) : fudge(x) {
  }
  virtual void do_something();
};

class bar : public foo {
public:
  bar(int x) : foo(x) {
  }
  void do_something() {
  }
};

int main() {
  bar(0);
  return 0;
}


Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/2.95.1/specs
gcc version 2.95.1 19990816 (release)
  [ stuff deleted ]
/tmp/ccRtcD7X.o: In function `bar type_info function':
/tmp/ccRtcD7X.o(.gnu.linkonce.t.__tf3bar+0x10): undefined reference to `foo type_info function'
/tmp/ccRtcD7X.o(.gnu.linkonce.t.__tf3bar+0x1a): undefined reference to `foo type_info node'
/tmp/ccRtcD7X.o: In function `bar::bar(int)':
/tmp/ccRtcD7X.o(.bar::gnu.linkonce.t.(int)+0x14): undefined reference to `foo::foo(int)'
collect2: ld returned 1 exit status
-- 
	-lauther

----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens CT SE 6         Internet: Ulrich.Lauther@mchp.siemens.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]