Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: From: "Schaible, Joerg" To: "'cygwin-list'" Cc: "'jeffdbREMOVETHIS AT goodnet DOT com'" Subject: RE: DLL's and inlined methods Date: Fri, 7 May 1999 17:48:27 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id LAA27898 As you may see below in the command line of the compiler building Mumit's sample no -O option is set. If I set -fno-default-inline situation gets even worse, since I will get duplicate symbols also for the inlined methods of the standard C++ headers. > -----Original Message----- > From: jeffdbREMOVETHIS AT goodnet DOT com [SMTP:jeffdbREMOVETHIS AT goodnet DOT com] > Sent: Friday, May 07, 1999 4:52 PM > To: Schaible, Joerg > Subject: Re: DLL's and inlined methods > > Without -O NO methods are made inline > > On Fri, 7 May 1999 13:34:00 +0200 , you wrote: > > >Hello, > > > >me again. I got trouble building a dll with classes that have inlined > >methods. I've modified Mumit's sample to demonstrate the problem: > > > >// dllclass.h: > > > >class DLLIMPORT > >DllClass : public DllClassBase { > >public: > > DllClass (int i = 0); > > ~DllClass (); > > int non_virtual_method () const; > > virtual int virtual_method () const; > >// ======== Added inlined method here ============= > > int inline_method() const { for( int i = 40, j = 0; i--; ) j++; } > >#ifdef __GNUC__ > > DLLIMPORT // work around an egcs-1.1 bug > >#endif > > static int instances; > >private: > > int i_; > >}; > > > >// dllclass.cc: > > > >// added this function > >void dummy1() > >{ > > DllClass dc; > > dc.inline_method(); > >} > > > > > >// dllinline.cc <== Added new module to DLL > > > >#include "dllclass.h" > > > >void dummy2() > >{ > > DllClass dc; > > dc.inline_method(); > >} > > > > > >I will have following error message running make: > > > >c++ -c -DBUILDING_DLL=1 -I. -g -o dllclass.o dllclass.cc > >c++ -c -DBUILDING_DLL=1 -I. -g -o dllexterns.o dllexterns.cc > >c++ -c -DBUILDING_DLL=1 -I. -g -o dllinline.o dllinline.cc > >gcc -c -DBUILDING_DLL=1 -I. -g -o dllinit.o dllinit.c > >dllwrap --export-all --output-def cxxdll.def --implib libcxxdll.a > >--driver-name c++ -o cxxdll.dll \ > > dllclass.o dllexterns.o dllinline.o dllinit.o > >Warning: no export definition file provided > >dllwrap will create one, but may not be what you want > >dllinline.o: In function `DllClass::inline_method(void) const': > >/egcs-1-1-2/dllhelpers-0.2.5/c++/dllclass.h:26: multiple definition of > >`DllClass::inline_method(void) const' > >dllclass.o(.text$inline_method__C8DllClass+0x0):/egcs-1-1-2/dllhelpers-0. > 2.5 > >/c++/dllclass.cc: first defined here > >collect2: ld returned 1 exit status > >dllwrap: c++ exited with status 1 > >make: *** [cxxdll.dll] Error 1 > > > > > >Any suggestions ? > >Jörg -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com