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: <7FD5C79AD680D211AC4100A0C96B501C010789E2@orsmsx49.jf.intel.com> From: "Brimhall, GeoffreyX L" To: "Schaible, Joerg" , "'cygwin-list'" Subject: RE: DLL's and templates Date: Thu, 6 May 1999 09:17:47 -0700 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 MAA22728 You're not using the template invocation correctly: static B b; // Incorrect, based on the example you gave. // Compiler should have not even allowed the // linkage stage, so you're definately missing // something in your code example ! It needs something like this: class C { int m_dummy; }; static B b; // This is correct. My suspicion is the C class, which you left out, has some virtual functions in it which you have not filled out ? -----Original Message----- From: Schaible, Joerg [mailto:Joerg DOT Schaible AT gft DOT de] Sent: Thursday, May 06, 1999 12:13 AM To: 'cygwin-list' Subject: DLL's and templates Hello, currently I am trying to link my own first DLL (Mumits samples worked quite well), but I got unresolved externals for the vtable of all template classes used within my DLL. Typically following code: // header.h class __declspec(dllexport) A { public: A() {} virtual ~A() {} }; template class B : public A { public: B() {} virtual ~B() {} }; // module.cxx static B b; Compiling and linking the DLL I will have an unresolved external vor the vtable of B or for inlined virtual destructors. B is not necessarily exported. Original error messages: ..\egcs112\rel\gwbase\sh\gwstrsb.o(.text+0x2ba3):gwstrsb.cc: undefined reference to `GwSingletonClass::~GwSingletonClass(void)' ..\egcs112\rel\gwbase\sh\gwstrwc.o(.text$__t13GwTMemoryPool1Z13GwWCStringImp i+0x6b):gwstrwc.cc: undefined reference to `GwTMemoryPool virtual table' Greetings Jörg -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com