Received: by oss.sgi.com id ; Mon, 19 Jun 2000 04:35:10 -0700 Received: from mp-sun1.informatik.uni-mannheim.de ([134.155.65.59]:6663 "EHLO mp-sun1.informatik.uni-mannheim.de") by oss.sgi.com with ESMTP id ; Mon, 19 Jun 2000 04:35:01 -0700 Received: from volumegraphics.com (guenther@mp-pc45 [134.155.65.10]) by mp-sun1.informatik.uni-mannheim.de (8.9.3/8.9.3) with ESMTP id NAA25082 for ; Mon, 19 Jun 2000 13:34:49 +0200 Message-ID: <394E0564.89E7E143@volumegraphics.com> Date: Mon, 19 Jun 2000 13:35:00 +0200 From: Thomas Guenther Organization: Volume Graphics GmbH X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.4 i686) X-Accept-Language: en MIME-Version: 1.0 To: pro64-support@oss.sgi.com Subject: multiple definitions Content-Type: multipart/mixed; boundary="------------060F5176F606947A56BF69DA" Sender: owner-pro64-support@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;pro64-support-outgoing This is a multi-part message in MIME format. --------------060F5176F606947A56BF69DA Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I got a multiple definition problem, compiling my test program under NUE with sgi++. The problem appears only, if I include iostream.h in both helloClass.h and helloClass.cxx. Is there any compiler option to avoid this ? Thanks in advance Thomas hello.o: In function `virtual function thunk (delta:-8) for _IO_ostream_withassign::~_IO_ostream_withassign(void)': hello.o(.text+0x4b0): multiple definition of `virtual function thunk (delta:-8) for _IO_ostream_withassign::~_IO_ostream_withassign(void)' helloClass.o(.text+0x420): first defined here hello.o: In function `virtual function thunk (delta:-16) for _IO_istream_withassign::~_IO_istream_withassign(void)': hello.o(.text+0x580): multiple definition of `virtual function thunk (delta:-16) for _IO_istream_withassign::~_IO_istream_withassign(void)' helloClass.o(.text+0x4f0): first defined here hello.o: In function `virtual function thunk (delta:-24) for iostream::~iostream(void)': hello.o(.text+0x650): multiple definition of `virtual function thunk (delta:-24) for iostream::~iostream(void)' helloClass.o(.text+0x5c0): first defined here hello.o: In function `virtual function thunk (delta:-16) for istream::~istream(void)': hello.o(.text+0x720): multiple definition of `virtual function thunk (delta:-16) for istream::~istream(void)' helloClass.o(.text+0x690): first defined here hello.o: In function `virtual function thunk (delta:-8) for ostream::~ostream(void)': hello.o(.text+0x920): multiple definition of `virtual function thunk (delta:-8) for ostream::~ostream(void)' helloClass.o(.text+0x890): first defined here collect2: ld returned 1 exit status uname -a Linux mp-pc45 2.2.4 #1 SMP Wed Jun 23 13:23:12 MEST 1999 ia64 unknown sgicc -version SGIcc Compilers: Version 0.01.0-9 -- Thomas Guenther Tel:+49-621-292-3085 Volume Graphics GmbH Fax:+49-621-292-5756 Kraemergasse 14/1 Email:guenther@volumegraphics.com D-69117 Heidelberg http://www.volumegraphics.com --------------060F5176F606947A56BF69DA Content-Type: text/plain; charset=us-ascii; name="hello.cxx" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hello.cxx" #include #include main() { helloWorld h; h.output(); } --------------060F5176F606947A56BF69DA Content-Type: text/plain; charset=us-ascii; name="helloClass.cxx" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="helloClass.cxx" #include #include void helloWorld:: output() { cout << str; } --------------060F5176F606947A56BF69DA Content-Type: text/plain; charset=us-ascii; name="helloClass.h" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="helloClass.h" #include class helloWorld { public: helloWorld() { strcpy(str,"huhu");}; virtual ~helloWorld() {}; void output(); private: char str[200]; }; --------------060F5176F606947A56BF69DA--