delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/07/07:34:37

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: <C2D7D58DBFE9D111B0480060086E96358D6FAB@gftmail.gft.de>
From: "Schaible, Joerg" <Joerg DOT Schaible AT gft DOT de>
To: "'cygwin-list'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: DLL's and inlined methods
Date: Fri, 7 May 1999 13:34:00 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id HAA10564

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019