delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/26/12:02:35

From: "Chia" <chia AT top DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Templates in libraries / external templates?
Date: Thu, 26 Nov 1998 10:33:02 -0600
Organization: 404 Software
Lines: 35
Message-ID: <73jvjp$pgf@nnrp4.farm.idt.net>
NNTP-Posting-Host: flex-30.top.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.0810.800
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hey all
I've made some progress and got the classes to all recognize each other.
The only problem I'm still having is with a template class in my program...

I've got a special list template which I've been using, with its interface
in jglist.h and its implementation in jglist.cpp.  Now, I compiled the .cpp
into a .o file and ar'd that into the library, but when I go to compile it
gives me error messages such as:

c:/djgpp/lib/libjgui.a(desktop.o)(.text+0x947):desktop.cc: undefined
reference to 'jgList<Container>::Remove(Container *)'

Desktop is a class which uses the list.  The desktop.h file includes
jglist.h, so I don't really know why it can't do this correctly.

In the docs I found some info on this and I put:

    #pragma interface
    #pragma implementation "jglist.cpp"

In the jglist header and compiled it with -fexternal-templates.  This still
didn't work and I got the same errors.

Can someone explain to me how to set this all up correctly?

Thanks!

    Jared

--
[ chia AT top DOT net ]
[ jared AT underdark DOT net ]
[ ab031 AT thor DOT unomaha DOT edu ]


- Raw text -


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