home *** CD-ROM | disk | FTP | other *** search
- From: defaria@hpcuhe.cup.hp.com (Andy DeFaria)
- Date: Mon, 28 Dec 1992 08:47:24 GMT
- Subject: Problem with BC++ 3.0 TLINK and missing symbols
- Message-ID: <33820012@hpcuhe.cup.hp.com>
- Organization: Hewlett Packard, Cupertino
- Path: sparky!uunet!munnari.oz.au!spool.mu.edu!nigel.msen.com!sdd.hp.com!col.hp.com!news.dtc.hp.com!hpscit.sc.hp.com!hplextra!hpcss01!hpcuhe!defaria
- Newsgroups: comp.lang.c++
- Lines: 41
-
- I have been receiving errors from Borland C++ 3.0 of the form:
-
-
- Linker Error: Undefined symbol foo<int>::foobar() in module BAR.C
-
- given the following files:
-
- FOO.H:
- ------
- template <class TYPE>
- class foo {
- private:
- int i;
- public:
- void foobar (void);
- };
-
- FOO.C:
- ------
- #include "foo.h"
-
- template <class TYPE>
- void foo<TYPE>::foobar (void) {
- i++;
- } // foobar
-
- BAR.C:
- ------
- #include "foo.h"
-
- void main (void) {
- foo<int> x;
-
- x.foobar ();
- } // main
-
- These example is a chopped down version of the real one that I had originally
- had had problems with. Notice that there is no need for a template anymore as
- TYPE is not really used. I am using Borland C++ 3.0 and in the IDE I create a
- project file that has both FOO.C and BAR.C. Every thing compiles but fails to
- link with the above message. Why?
-