Article View: gnu.g++.help
Article #136Disappearing Template object code
From: Mark Stubley
Date: Wed, 12 Aug 1992 14:07
Date: Wed, 12 Aug 1992 14:07
27 lines
1406 bytes
1406 bytes
I am currently using g++2.2.2 to write a library that makes use of a template for a hash table. This class alon g with a class that uses it are in a link time library. When a program is compiled that uses the library then all references to the specific instance of the template class are undefined. Running nm on the template object files reveals they don't contain any class specific symbols. If I write a simple test program with the template definitions in the same file as instances are declared then it works fine. As soon as I move the definitions to a different file I get link failures on the template constructors. Have I missed something obvious ? Thanks in advance Mark -- =========================================================================== Mark A. Stubley (mas@fulcrum.bt.co.uk) =========================================================================== Fulcrum communications L.T.D., Fordrough Lane, Birmingham, B9 5LD, ENGLAND.
Technical Details
Message-ID:
<MAS.92Aug12140728@vlad-vladikoff.fulcrum.bt.co.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!strath-cs!fulcrum!masShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!strath-cs!fulcrum!mas From: mas@fulcrum.bt.co.uk (Mark Stubley) Newsgroups: gnu.g++.help,comp.lang.c++ Subject: Disappearing Template object code Message-ID: <MAS.92Aug12140728@vlad-vladikoff.fulcrum.bt.co.uk> Date: 12 Aug 92 14:07:28 GMT Sender: news@fulcrum.bt.co.uk Organization: Fulcrum Communications Ltd., Birmingham, England Lines: 27