🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.os.linux.mandrake
Article #497

Re: the phrases "undefined reference" and "in-charge"

#497
From: Novice
Date: Fri, 31 Oct 2003 18:27
93 lines
5202 bytes
"Novice" <cassidy@cs.queensuDOTca> wrote in message
news:bnu3b2$gun$1@knot.queensu.ca...
|
| "Guy Harrison" <swamp-DEL-dog@ntlworld.com> wrote in message
| news:49a971-7i42.ln1@sd.swampdog...
| | Novice wrote:

[snip]

|
| When I use your makefile after compiling all of the cpp files I get the
| following:
| [cassidy@txl thesisCode]$ make
| g++ -o timsProgram Throwable.o BufferedOutputStream.o BufferedWriter.o
| Hashtable.o MainEntry.o MonitorDataLINUX.o TimDynamic.o TimMonitor.o
| TimObject.o TimString.o TimSystem.o
| BufferedOutputStream.o(.text+0xe): In function
| `txl::io::BufferedOutputStream::BufferedOutputStream[not-in-charge]()':
| : undefined reference to
| `txl::io::FilterOutputStream::FilterOutputStream[not-in-charge]()'
| BufferedOutputStream.o(.text+0x74): In function
| `txl::io::BufferedOutputStream::BufferedOutputStream[in-charge]()':
| : undefined reference to
| `txl::io::FilterOutputStream::FilterOutputStream[not-in-charge]()'
|
BufferedOutputStream.o(.gnu.linkonce.d._ZTVN4txl2io20BufferedOutputStreamE+0
| x50): undefined reference to `txl::io::FilterOutputStream::close()'
|
BufferedOutputStream.o(.gnu.linkonce.t._ZN4txl2io18FilterOutputStreamD2Ev+0x
| b): In function `txl::io::FilterOutputStream::~FilterOutputStream
| [not-in-charge]()':
| : undefined reference to `vtable for txl::io::FilterOutputStream'
|
BufferedOutputStream.o(.gnu.linkonce.t._ZN4txl2io18FilterOutputStreamD2Ev+0x
| 17): In function `txl::io::FilterOutputStream::~FilterOutputStream
| [not-in-charge]()':
| : undefined reference to `vtable for txl::io::FilterOutputStream'
|
BufferedOutputStream.o(.gnu.linkonce.d._ZTIN4txl2io20BufferedOutputStreamE+0
| x8): undefined reference to `typeinfo for txl::io::FilterOutputStream'
|
TimSystem.o(.gnu.linkonce.t._ZN4txl2io11PrintStreamC1E8SmartPtrINS0_12Output
| StreamEiEb+0x14): In function
|
`txl::io::PrintStream::PrintStream[in-charge](SmartPtr<txl::io::OutputStream
| , int>, bool)':
| : undefined reference to
| `txl::io::FilterOutputStream::FilterOutputStream[not-in-charge]()'
| TimSystem.o(.gnu.linkonce.d._ZTIN4txl2io11PrintStreamE+0x8): undefined
| reference to `typeinfo for txl::io::FilterOutputStream'
| collect2: ld returned 1 exit status
| make: *** [timsProgram] Error 1
|

[snip]

I've since created more cpp files for each of the header files and added
those arguments and now I get:
[cassidy@txl thesisCode]$ make
g++ -o timsProgram OutputStream.o FilterOutputStream.o
BufferedOutputStream.o Throwable.o BufferedWriter.o Hashtable.o MainEntry.o
MonitorDataLINUX.o TimDynamic.o TimMonitor.o TimObject.o TimString.o
TimSystem.o
BufferedOutputStream.o(.text+0x1a): In function
`txl::io::BufferedOutputStream::BufferedOutputStream[not-in-charge]()':
: undefined reference to `vtable for txl::io::BufferedOutputStream'
BufferedOutputStream.o(.text+0x26): In function
`txl::io::BufferedOutputStream::BufferedOutputStream[not-in-charge]()':
: undefined reference to `vtable for txl::io::BufferedOutputStream'
BufferedOutputStream.o(.text+0x80): In function
`txl::io::BufferedOutputStream::BufferedOutputStream[in-charge]()':
: undefined reference to `vtable for txl::io::BufferedOutputStream'
BufferedOutputStream.o(.text+0x8c): In function
`txl::io::BufferedOutputStream::BufferedOutputStream[in-charge]()':
: undefined reference to `vtable for txl::io::BufferedOutputStream'
BufferedOutputStream.o(.text+0xe6): In function
`txl::io::BufferedOutputStream::BufferedOutputStream[not-in-charge](SmartPtr
<txl::io::OutputStream, int>)':
: undefined reference to `vtable for txl::io::BufferedOutputStream'
BufferedOutputStream.o(.text+0xf2): more undefined references to `vtable for
txl::io::BufferedOutputStream' follow
collect2: ld returned 1 exit status
make: *** [timsProgram] Error 1

I don't know why - but the linker seems to be having a problem with the
constructor and destructor of BufferedOutputStream - I'm now explicitly
writing the implementation of the default constructor and the destructor in
the implementation/source file of BufferedOutputStream and
FilterOutputStream (which BufferedOutputStream extends).

Thanks,
Novice
Technical Details
Message-ID: <bnu9b3$oe8$1@knot.queensu.ca>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!snoopy.risq.qc.ca!torn!news.ccs.queensu.ca!not-for-mail
References: <bnrjs1$mmt$1@knot.queensu.ca> <49a971-7i42.ln1@sd.swampdog> <bnu3b2$gun$1@knot.queensu.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10ba33,c3065f741ba0d469
X-Google-Attributes: gid10ba33,public
X-Google-Thread: f8a83,c3065f741ba0d469
X-Google-Attributes: gidf8a83,public
X-Google-ArrivalTime: 2003-10-31 10:30:10 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!snoopy.risq.qc.ca!torn!news.ccs.queensu.ca!not-for-mail
From: "Novice" <cassidy@cs.queensuDOTca>
Newsgroups: alt.os.linux.mandrake,gnu.g++.help
Subject: Re: the phrases "undefined reference" and "in-charge"
Date: Fri, 31 Oct 2003 13:27:44 -0500
Organization: Queen's University, Kingston
Lines: 96
Message-ID: <bnu9b3$oe8$1@knot.queensu.ca>
References: <bnrjs1$mmt$1@knot.queensu.ca> <49a971-7i42.ln1@sd.swampdog> <bnu3b2$gun$1@knot.queensu.ca>
NNTP-Posting-Host: polka.cs.queensu.ca
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165